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...

how to find the given number is prime or not?

Answer Posted / rahul tiwari

main()
{
int n,ctr=2,flag=0;
printf("enter the number to be checked\n");
scanf("%d",&n);
for(ctr=2;ctr<=n/2;ctr++)
{
if(n%ctr==0)
{
flag=1;
break;
}
}
if(flag==1)
printf("the given number is prime\n");
else
printf("the given number is not prime\n");
flag=9
getch();
}

Is This Answer Correct ?    8 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why does not c have an exponentiation operator?

1047


What is n in c?

1042


pierrot's divisor program using c or c++ code

2240


How many types of arrays are there in c?

1046


What is the sizeof () operator?

1081


What is the use of sizeof () in c?

1051


Is c programming hard?

1027


difference between native and cross compilers

2125


What are the header files used in c language?

1055


What is preprocessor with example?

1061


What is static identifier?

1222


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

1063


What is the return type of sizeof?

1066


Are there constructors in c?

1008


What does c mean in standard form?

1172