write the program for prime numbers?
Answer Posted / arfu
#include<stdio.h>
int main()
{
int c,i,n;
c=0;
scanf("%d",&a);
for(i=2;i<a;i++)
if (n%i==0)
{
c=1;break;
}
if(c!=1)`("prime");
else printf ("not a prime");
}
| Is This Answer Correct ? | 110 Yes | 89 No |
Post New Answer View All Answers
How can I pad a string to a known length?
What is "Duff's Device"?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
What are the main characteristics of c language describe the structure of ac program?
What is advantage of pointer in c?
What is a char c?
void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply
What is memory leak in c?
Explain 'far' and 'near' pointers in c.
What are the 3 types of structures?
What is queue in c?
What is calloc() function?
What is integer constants?
How many keywords (reserve words) are in c?
What is the difference between array and pointer?