write the program for prime numbers?
Answer Posted / d.sukumar
void main()
{
int i,k;int count=0;
int n;
printf("enter a no");
scanf("%d",&n);
for(i=2;i<=n;i++)
{
k=n%i;
if(k==0)
{
count++;
}
}
if(count==1)
printf("prime");
else
printf("not prime");
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is ambagious result in C? explain with an example.
Why is C language being considered a middle level language?
Place the #include statement must be written in the program?
Are pointers integers in c?
What is conio h in c?
Difference between strcpy() and memcpy() function?
What are the similarities between c and c++?
What is #line?
what is a function method?give example?
What is adt in c programming?
What is the maximum length of an identifier?
Apart from dennis ritchie who the other person who contributed in design of c language.
What are the rules for the identifier?
Why should I use standard library functions instead of writing my own?
Why static is used in c?