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

When should a type cast be used?

1011


Which is best book for data structures in c?

1093


How can you determine the size of an allocated portion of memory?

1299


What is Dynamic memory allocation in C? Name the dynamic allocation functions.

1413


Explain what is a 'locale'?

1081


What are multidimensional arrays?

1121


What is an endless loop?

1273


What is the difference between local variable and global variable in c?

1230


What is a pointer on a pointer in c programming language?

1139


What is the explanation for prototype function in c?

980


Is that possible to add pointers to each other?

1369


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

1097


if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

1944


how to build a exercise findig min number of e heap with list imlemented?

2076


Differentiate Source Codes from Object Codes

1568