write the program for prime numbers?
Answer Posted / akhilesh singh(m.c.a-iisem ois
main()
{
int i,j=2,ch=0;
clrscr();
printf("\nENTER ANY NUMBER");
scanf("%d",&i);
while(j<=i/2)
{
if(i%j==0)
{
printf("%d IS NOT PRIME",i);
ch=1;
break;
}
else
{
j++;
}
}
if(ch==0)
{
printf("%d IS PRIME",i);
}
}
| Is This Answer Correct ? | 1243 Yes | 384 No |
Post New Answer View All Answers
What is multidimensional arrays
How do I round numbers?
Does sprintf put null character?
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
How to establish connection with oracle database software from c language?
What does it mean when a pointer is used in an if statement?
What is malloc calloc and realloc in c?
What are the 4 types of functions?
What is typedf?
What does it mean when the linker says that _end is undefined?
What is the c value paradox and how is it explained?
Which function in C can be used to append a string to another string?
What is difference between array and structure in c?
Why do we need functions in c?
What is use of #include in c?