write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / sathya
#include<iostream.h>
void main()
{
int n,a;
cout<<"enter the limit";
cin>>n;
for(i=1;i<=n;i++}
{
if(i=1)
{
cout<<"1 is neither a prime nor a composite no";
}
else if(i%1==0|i%i==0)
{
cout<<i<<"is a prime number";
}
}
}
| Is This Answer Correct ? | 63 Yes | 165 No |
Post New Answer View All Answers
How is = symbol different from == symbol in c programming?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
What do you mean by a local block?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
What are local static variables?
Explain what does the format %10.2 mean when included in a printf statement?
Does c have function or method?
In a switch statement, explain what will happen if a break statement is omitted?
What is build process in c?
how to build a exercise findig min number of e heap with list imlemented?
What are the application of c?
What are the ways to a null pointer can use in c programming language?
Why void main is used in c?
What does == mean in texting?
What do you know about the use of bit field?