write the program for prime numbers?
Answer Posted / biswa
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 ? | 311 Yes | 310 No |
Post New Answer View All Answers
What is the purpose of realloc()?
What does node * mean?
Find MAXIMUM of three distinct integers using a single C statement
How can I generate floating-point random numbers?
What is the process to generate random numbers in c programming language?
Define the scope of static variables.
What is c programming structure?
Explain how can a program be made to print the name of a source file where an error occurs?
What is a program flowchart?
What is function pointer c?
Is null valid for pointers to functions?
Write programs for String Reversal & Palindrome check
What is extern storage class in c?
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
What is a stream water?