write the program for prime numbers?
Answer Posted / venkat reddy
#include<stdio.h>
main()
{
int i,n,count=0;
printf("enter a no.");
scanf("%d",&n);
for(i=2;i<n;i++)
{
if(n%i==0)
{
count++;
}
}
if(count>1)
{
printf("not prime no.");
}
else
printf("prime");
}
| Is This Answer Correct ? | 344 Yes | 155 No |
Post New Answer View All Answers
What are derived data types in c?
What is the size of array float a(10)?
Why do we use return in c?
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
What is the difference between int main and void main?
What is a program?
Explain a pre-processor and its advantages.
What is data structure in c and its types?
program to convert a integer to string in c language'
How can I send mail from within a c program?
How can you avoid including a header more than once?
what does static variable mean?
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
Why is struct padding needed?
What is the use of c language in real life?