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 / venkat reddy

#include<stdio.h>
main()
{
int i,n,count=0;
printf("enter a no.");
scanf("%d",&n);
for(i=2;i<n;i++)

{
if(n%i==0)
{
count++;
}
}
if(count>1)
{
printf("not prime no.");

}
else
printf("prime");
}

Is This Answer Correct ?    344 Yes 155 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of macro in C language?

1063


Tell me about low level programming languages.

1064


Explain the difference between structs and unions in c?

957


what is the format specifier for printing a pointer value?

965


Is a pointer a kind of array?

1111


can any one tel me wt is the question pattern for NIC exam

1922


Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?

1075


What is sorting in c plus plus?

921


Are there constructors in c?

969


What is modifier & how many types of modifiers available in c?

982


Can a variable be both const and volatile?

1068


Differentiate between new and malloc(), delete and free() ?

1132


What is nested structure?

996


why wipro wase

2245


What is hashing in c?

1095