how i m write c program 1.check prime number 2.prime number
series
Answer Posted / sulthan
#include<stdio.h>
void main()
{
int a,i,n=0;
printf("\nEnter the Number");
scanf("%d",&a);
for(i=1;i<=a;i++)
if(a%i==0)
n++;
if(n=2)
printf("Prime")
else
printf("NOT Prime");
}
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What is an endless loop?
Difference between Shallow copy and Deep copy?
What is c definition?
What is equivalent to ++i+++j?
Why is void main used?
What is output redirection?
What are the data types present in c?
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
What is the explanation for the dangling pointer in c?
What is a void pointer in c?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
List the difference between a "copy constructor" and a "assignment operator"?
Is c is a middle level language?
For what purpose null pointer used?
Explain main function in c?