write the program for prime numbers?
Answer Posted / shubhanshu pandey
main()
{
int a,c=0,i,n;
printf("enter the number to be checked");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
a=n%i;
if(a=0)
{
c=c+1;
}
}
if (c=2)
{ printf("the given number is prime"); }
else
printf("the given number is not prime");
}
| Is This Answer Correct ? | 7 Yes | 4 No |
Post New Answer View All Answers
In c programming language, how many parameters can be passed to a function ?
What functions are used for dynamic memory allocation in c language?
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array
What is 'bus error'?
Difference between strcpy() and memcpy() function?
Explain what are reserved words?
What is meant by int main ()?
What is d'n in c?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
Which is an example of a structural homology?
Explain union. What are its advantages?
Why does everyone say not to use scanf? What should I use instead?
How would you rename a function in C?
What is header file definition?
Explain what is the general form of a c program?