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
What is a stream water?
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
What does the function toupper() do?
How can you allocate arrays or structures bigger than 64K?
Difference between strcpy() and memcpy() function?
When should a type cast be used?
What is p in text message?
Explain what is the difference between a free-standing and a hosted environment?
What is the difference between constant pointer and constant variable?
What is data structure in c and its types?
What is string concatenation in c?
What does printf does?
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
What is a void * in c?
Write a program that accept anumber in words