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
When is a “switch” statement preferable over an “if” statement?
How can you find out how much memory is available?
What are the 5 elements of structure?
Difference between strcpy() and memcpy() function?
Why do some versions of toupper act strangely if given an upper-case letter?
What is variable declaration and definition in c?
Here is a good puzzle: how do you write a program which produces its own source code as output?
What is the use of getch ()?
What is the difference between formatted&unformatted i/o functions?
What is a rvalue?
Explain the use of #pragma exit?
write a program to print largest number of each row of a 2D array
How does pointer work in c?
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?