write the program for prime numbers?
Answer Posted / sujeet
#include<iostrream.h>
#include<conio.h>
void main()
{
int n;
cin>>n;
if(n==2)
{
cout<<"no is prime")
if(n%2!=0)
{
if(n%3!=0)
{
if(n%5!=0)
{
if(n%7!=if(n%2!=0)
{
0)
{
if(n%11!=0)
{
if(n%13!=0)
{
cout<<"no is prime ";
}
}
}
}
}
}
}
}
}
getch()
}
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What are the uses of null pointers?
What do you mean by a sequential access file?
What is c preprocessor mean?
What is the best way to store flag values in a program?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
What are the disadvantages of a shell structure?
Define Array of pointers.
What is the difference between ++a and a++?
Why do we need a structure?
What is a sequential access file?
What are the basic data types associated with c?
What is the auto keyword good for?
Apart from dennis ritchie who the other person who contributed in design of c language.
What is extern storage class in c?
what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9