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 / naseer

main(){
int no,i,count=0;
printf("enter any no");
scanf("%d",&no);
//the main logic is here
for(i=2;i<no;i++){

if(no%2==0){
count++;
}
}
if(count>=1)// if the no is less than
//5 then it shows prime
{
printf("not Prime");
}

else
printf("prime");

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is define directive?

1214


write a c program to calculate sum of digits till it reduces to a single digit using recursion

3381


How to draw the flowchart for structure programs?

9390


What is the difference between printf and scanf in c?

1428


What is build process in c?

1204


What is the difference between %d and %i?

1147


Can you explain the four storage classes in C?

1166


What is the difference between #include

and #include “header file”?

1090


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

2149


Write a factorial program using C.

1120


What are valid signatures for the Main function?

1291


What is the process to create increment and decrement stamen in c?

1103


What is the modulus operator?

1258


What is uint8 in c?

1162


Is null equal to 0 in sql?

1189