write the program for prime numbers?
Answer Posted / vivek s
{
int n;
printf("\n Enter The Number\n");
scanf("%d",&n);
if(n>3 && n!=5 && n!=7)
if(n%2!=0)
if(n%3!=0)
if(n%5!=0)
if(n%7!=0)
printf("\n\n %d is a prime number",n);
else
printf("\n\n %d is not a prime number",n);
else
printf("\n\n %d is not a prime number",n);
else
printf("\n\n %d is not a prime number",n);
else
printf("\n\n %d is not a prime number",n);
else
printf("\n\n %d is a prime number",n);
getch();
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Can main () be called recursively?
When can you use a pointer with a function?
What are variables and it what way is it different from constants?
What is the size of structure pointer in c?
Explain how do you list files in a directory?
What is array in c with example?
What does char * * argv mean in c?
Can static variables be declared in a header file?
What is the method to save data in stack data structure type?
what is different between auto and local static? why should we use local static?
What is the scope of global variable in c?
Does c have class?
What is c variable?
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none