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
How do you determine whether to use a stream function or a low-level function?
Linked lists -- can you tell me how to check whether a linked list is circular?
What is a ternary operator in c?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
How reliable are floating-point comparisons?
c program to compute AREA under integral
Explain enumerated types.
What does %p mean c?
What are the different types of linkage exist in c?
How can I ensure that integer arithmetic doesnt overflow?
What is time null in c?
What is integer constants?
What does c mean before a date?
I have seen function declarations that look like this