write the program for prime numbers?

Answer Posted / pavankumar

void main()
{
int i=2;
int count=0;
int n;
printf("enter a no");
scanf("%d",&n);
for(i=2;i<n/2;i++)
{
if(n%i==0)
{
count++;
}
if(count>1)
{
prinf("prime");
else
printf("not prime");
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which built-in library function can be used to match a patter from the string?

745


What does %c mean in c?

647


What is a wrapper function in c?

588


hi, which software companys will take,if d candidate's % is jst 55%?

1660


What is quick sort in c?

581






How do you determine the length of a string value that was stored in a variable?

651


Does c have enums?

600


Why is sprintf unsafe?

617


How to declare pointer variables?

686


What are data types in c language?

582


What is console in c language?

603


What is scope rule in c?

603


What is meant by keywords in c?

616


Does c have class?

613


What is FIFO?

672