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 is the purpose of macro in C language?
Tell me about low level programming languages.
Explain the difference between structs and unions in c?
what is the format specifier for printing a pointer value?
Is a pointer a kind of array?
can any one tel me wt is the question pattern for NIC exam
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
What is sorting in c plus plus?
Are there constructors in c?
What is modifier & how many types of modifiers available in c?
Can a variable be both const and volatile?
Differentiate between new and malloc(), delete and free() ?
What is nested structure?
why wipro wase
What is hashing in c?