write the program for prime numbers?
Answer Posted / manish kumar
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 ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do you do dynamic memory allocation in C applications?
What language is windows 1.0 written?
What is main () in c language?
Can two or more operators such as and be combined in a single line of program code?
What are the types of pointers in c?
What is an example of structure?
Why is python slower than c?
How can I use a preprocessorif expression to ?
What is oops c?
write an algorithm to display a square matrix.
How do I use strcmp?
What is keyword in c?
What does 4d mean in c?
In C language what is a 'dangling pointer'?
What is dynamic memory allocation?