write the program for prime numbers?
Answer Posted / samson mugambi
#include<stdio.h>
int main()
{
int c,i,n;
counter=0;
scanf("%d",&a);
for(i=2;i>a;i++)
if (n%i==0)
{
c=1;break;
}
if(c!=1) ("prime");
else print ("not a prime");
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is scope and lifetime of a variable in c?
What is the maximum length of an identifier?
What are comments and how do you insert it in a C program?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
What is scope of variable in c?
Why & is used in c?
What is the scope of an external variable in c?
What is the purpose of ftell?
Explain what header files do I need in order to define the standard library functions I use?
Can we replace the struct function in tree syntax with a union?
Write a program to swap two numbers without using third variable?
Explain how can I remove the trailing spaces from a string?
shorting algorithmS
What is identifiers in c with examples?
What is the use of pointers in C?