write the program for prime numbers?
Answer Posted / felix c. intelegando
#include<stdio.h>
#include<conio.h>
int main(void)
{
int i,n,count=0;
printf("Enter Number: ");
scanf("%d",&n);
for(i=2;i<n;i++)
{
if(n%i==0)
{
count++;
}
}
if(count>1)
{
printf("Not Prime ");
}
else
printf("Prime");
getch();
return 0;
}
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
Can the sizeof operator be used to tell the size of an array passed to a function?
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
What are operators in c?
Explain what is wrong in this statement?
What is structure pointer in c?
What are header files why are they important?
Where we use clrscr in c?
What is a built-in function in C?
Can we access the array using a pointer in c language?
please send me the code for multiplying sparse matrix using c
Why is sprintf unsafe?
What is the use of a static variable in c?
What is 02d in c?
How can my program discover the complete pathname to the executable from which it was invoked?
What is the condition that is applied with ?: Operator?