Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
who to c programing of prime number
0
votes
asked
May 1, 2018
by
Arup Singh
(
140
points)
Please
log in
or register to answer this question.
1 Answer
0
votes
answered
May 1, 2018
by
jahurul25
(
140
points)
#include <stdio.h>
int main()
{
printf("Enter number : ");
int n,c=0,i;
scanf("%d",&n);
for(i = 2; i<=n/2; i++)
{
if(n % i == 0)
{
c = 1;
break;
}
}
if(c==0)
printf("%d is prime number",n);
else
printf("%d is not prime number",n);
return 0;
}
Please
log in
or register to add a comment.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...