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
if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.
How #define works?
Can include files be nested?
What's the total generic pointer type?
Is c still used?
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above
Who developed c language and when?
What is pointer and structure in c?
What is scanf () in c?
What is c variable?
Write a program to find the biggest number of three numbers in c?
how to write a c program to print list of fruits in alpabetical order?
Which of these functions is safer to use : fgets(), gets()? Why?
Are local variables initialized to zero by default in c?
What is the purpose of clrscr () printf () and getch ()?