write the program for prime numbers?
Answer Posted / vivek s
{
int n;
printf("\n Enter The Number\n");
scanf("%d",&n);
if(n>3 && n!=5 && n!=7)
if(n%2!=0)
if(n%3!=0)
if(n%5!=0)
if(n%7!=0)
printf("\n\n %d is a prime number",n);
else
printf("\n\n %d is not a prime number",n);
else
printf("\n\n %d is not a prime number",n);
else
printf("\n\n %d is not a prime number",n);
else
printf("\n\n %d is not a prime number",n);
else
printf("\n\n %d is a prime number",n);
getch();
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What are qualifiers?
What are global variables?
How many types of sorting are there in c?
What is the difference between malloc() and calloc() function in c language?
What is the difference between break and continue?
Write the syntax and purpose of a switch statement in C.
Explain union. What are its advantages?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
What is the difference between volatile and const volatile?
What is the use of define in c?
Distinguish between actual and formal arguments.
Why does this code crash?
What is pointer and structure in c?
I have a varargs function which accepts a float parameter?
which type of aspect you want from the student.