Write a program to find whether the given number is prime or
not?
Answer Posted / sudha
#include<stdio.h>
#include<conio.h>
void main()
{
int isprime=1;
int n,i;
printf("enter a number");
scanf("%d",&n);
if(i=2;i<=n/2;i++)
{
if((n%i)==0)
{
isprime=0;
break;
}
}
if(isprime==1)
{
printf("%d is a prime number",n);
}
else
{
printf("%d is not a prime number",n);
}
getch();
}
| Is This Answer Correct ? | 18 Yes | 5 No |
Post New Answer View All Answers
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
Differentiate Source Codes from Object Codes
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What is break in c?
Does c have class?
Tell me what is null pointer in c?
What is function prototype?
the question is that what you have been doing all these periods (one year gap)
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 the purpose of 'register' keyword in c language?
What oops means?
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm
What is difference between %d and %i in c?
Explain the use of fflush() function?
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical