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 / akhilesh singh(m.c.a-iisem ois

main()
{
int i,j=2,ch=0;
clrscr();
printf("\nENTER ANY NUMBER");
scanf("%d",&i);
while(j<=i/2)
{
if(i%j==0)
{
printf("%d IS NOT PRIME",i);
ch=1;
break;
}
else
{
j++;
}
}
if(ch==0)
{
printf("%d IS PRIME",i);
}
}

Is This Answer Correct ?    1243 Yes 384 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.

5144


How #define works?

1051


Can include files be nested?

1062


What's the total generic pointer type?

1014


Is c still used?

1000


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

1199


Who developed c language and when?

1018


What is pointer and structure in c?

1079


What is scanf () in c?

1057


What is c variable?

1000


Write a program to find the biggest number of three numbers in c?

1008


how to write a c program to print list of fruits in alpabetical order?

2243


Which of these functions is safer to use : fgets(), gets()? Why?

1046


Are local variables initialized to zero by default in c?

985


What is the purpose of clrscr () printf () and getch ()?

1025