write the program for prime numbers?
Answer Posted / pavankumar
void main()
{
int i=2;
int count=0;
int n;
printf("enter a no");
scanf("%d",&n);
for(i=2;i<n/2;i++)
{
if(n%i==0)
{
count++;
}
if(count>1)
{
prinf("prime");
else
printf("not prime");
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
to find the closest pair
Why do we use null pointer?
What is this pointer in c plus plus?
Why can arithmetic operations not be performed on void pointers?
Is it better to use malloc() or calloc()?
What does %c do in c?
When should a type cast not be used?
What is the difference between single charater constant and string constant?
Why c is called top down?
Why c is a mother language?
Why c language is called c?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
What is exit() function?
How can I prevent another program from modifying part of a file that I am modifying?