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 / d.sukumar

void main()
{
int i,k;int count=0;
int n;
printf("enter a no");
scanf("%d",&n);
for(i=2;i<=n;i++)
{
k=n%i;
if(k==0)
{
count++;
}
}
if(count==1)
printf("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

What is quick sort in c?

1096


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

1129


explain what is a newline escape sequence?

1095


When the macros gets expanded?

1433


List out few of the applications that make use of Multilinked Structures?

2201


Write the control statements in C language

1217


Which type of language is c?

1081


What is the size of a union variable?

1055


What is malloc() function?

1172


Explain high-order bytes.

1124


Why we not create function inside function.

2206


Is there a way to switch on strings?

1091


WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..

2089


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1227


What is a pointer in c?

1584