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 is the difference between pure virtual function and virtual function?
Explain how do you determine whether to use a stream function or a low-level function?
the question is that what you have been doing all these periods (one year gap)
Is javascript written in c?
What is the use of header files?
how to introdu5ce my self in serco
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
What is time complexity c?
What does *p++ do? What does it point to?
What does the error 'Null Pointer Assignment' mean and what causes this error?
What is null in c?
How are pointers declared in c?
What is the difference between a string and an array?
Here is a neat trick for checking whether two strings are equal
What are the differences between Structures and Arrays?