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 / manish kumar

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 ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between declaring a variable and defining a variable?

1054


How main function is called in c?

1134


Why use int main instead of void main?

1127


Write a program to print fibonacci series without using recursion?

1150


What's the best way of making my program efficient?

1110


Explain what is the difference between functions getch() and getche()?

1063


What is substring in c?

1212


What is the difference between char array and char pointer?

1071


Explain is it valid to address one element beyond the end of an array?

1226


What is void pointers in c?

1019


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

2137


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

2269


What does the format %10.2 mean when included in a printf statement?

1662


What is the function of this pointer?

1353


What is getch () for?

1248