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


Please Help Members By Posting Answers For Below Questions

Is c call by value?

593


What is the process of writing the null pointer?

600


What is structure in c explain with example?

623


Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc

5051


define string ?

660






Place the #include statement must be written in the program?

561


What is a program flowchart?

593


What is structure packing in c?

596


What is a global variable in c?

582


write a program fibonacci series and palindrome program in c

626


What is calloc malloc realloc in c?

582


When should the register modifier be used? Does it really help?

598


Explain what does the format %10.2 mean when included in a printf statement?

769


How are variables declared in c?

588


What is a keyword?

738