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 text and binary i/o?
Lists the benefits of c programming language?
What is wrong with this program statement?
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
How do you define CONSTANT in C?
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
What are pointers in C? Give an example where to illustrate their significance.
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
What is character set?
What is the role of && operator in a program code?
Tell me the use of bit field in c language?
What is the purpose of main() function?
all c language question
Tell me what are bitwise shift operators?
Explain what are header files and explain what are its uses in c programming?