Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write the program for prime numbers?

Answer Posted / felix c. intelegando

#include<stdio.h>
#include<conio.h>


int main(void)
{
int i,n,count=0;
printf("Enter Number: ");
scanf("%d",&n);
for(i=2;i<n;i++)

{
if(n%i==0)
{
count++;
}
}
if(count>1)
{
printf("Not Prime ");

}
else
printf("Prime");

getch();
return 0;
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is use of malloc and calloc?

1910


What is variable declaration and definition in c?

903


What is identifier in c?

1016


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

1268


There seem to be a few missing operators ..

1053


What are the advantages of using linked list for tree construction?

1104


The statement, int(*x[]) () what does in indicate?

1155


What is fflush() function?

1141


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

1258


In a switch statement, explain what will happen if a break statement is omitted?

1078


What is the difference between pure virtual function and virtual function?

1133


What is uint8 in c?

1108


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?

1216


What is the difference between scanf and fscanf?

1273


What are the two forms of #include directive?

1171