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

# include <iostream.h>
# include <conio.h>
int main()
{
int i,j=2,num=0;
cout<<"\n Enter the number";
cin>>i%j>>i;
while(j<=i/2)
{
if(i%j==0)
{
Cout<<"%d Is not prime number"<<i;
ch=1;
break;
}
else
{
j++;
}
}
if(num==0)
{
Cout<<"%d Is prime number"<<i;
}
getch();
return 0;

}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is far pointer in c?

1321


Which is better between malloc and calloc?

1211


Who developed c language and when?

1073


What is the use of f in c?

988


What is volatile c?

1026


Give differences between - new and malloc() , delete and free() ?

1105


Can you add pointers together? Why would you?

1134


Explain how can I remove the trailing spaces from a string?

1058


Are global variables static in c?

1178


What is quick sort in c?

1099


how to introdu5ce my self in serco

2011


what is the different bitween abap and abap-hr?

2343


How do I determine whether a character is numeric, alphabetic, and so on?

1140


What are type modifiers in c?

1061


Explain how can you be sure that a program follows the ansi c standard?

1484