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
Explain c preprocessor?
What is meant by 'bit masking'?
What is a program flowchart and explain how does it help in writing a program?
Explain #pragma statements.
Is c procedural or object oriented?
What is table lookup in c?
Why is structure padding done in c?
How does struct work in c?
What is difference between constant pointer and constant variable?
What is FIFO?
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..
What is difference between && and & in c?
What is d scanf?
Why is it that not all header files are declared in every C program?
What is adt in c programming?