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 difference between class and structure?

1074


How can I open files mentioned on the command line, and parse option flags?

1029


What are the different categories of functions in c?

1096


How will you delete a node in DLL?

1240


What is operator precedence?

1158


What does it mean when the linker says that _end is undefined?

1054


the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none

1008


What is the concatenation operator?

1095


What is this infamous null pointer, anyway?

996


5 Write an Algorithm to find the maximum and minimum items in a set of ā€˜n’ element.

2058


What is c mainly used for?

1008


How will you find a duplicate number in a array without negating the nos ?

2098


Mention four important string handling functions in c languages .

1055


What is the sizeof () operator?

1034


Explain two-dimensional array.

1021