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

Can the sizeof operator be used to tell the size of an array passed to a function?

1057


a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler

1023


What are operators in c?

962


Explain what is wrong in this statement?

1068


What is structure pointer in c?

989


What are header files why are they important?

1044


Where we use clrscr in c?

1090


What is a built-in function in C?

1513


Can we access the array using a pointer in c language?

995


please send me the code for multiplying sparse matrix using c

2120


Why is sprintf unsafe?

998


What is the use of a static variable in c?

1008


What is 02d in c?

1028


How can my program discover the complete pathname to the executable from which it was invoked?

1034


What is the condition that is applied with ?: Operator?

1070