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

#include<iostream.h>
#include<conio.h>
void main()
{
int no,i,r,p=1;
cout<<"enter a no";
cin>>no;
for(i=2;i<no;i++)
{
if(r==no%i)
{
p=0;
break;
}
}
if(p==0)
{
cout<<"the prime no";
}
else
{
cout<<"the no is note prime";
}
getch();
}

Is This Answer Correct ?    13 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is a const pointer?

1091


can any one tel me wt is the question pattern for NIC exam

1990


What are dangling pointers? How are dangling pointers different from memory leaks?

1328


Explain the properties of union. What is the size of a union variable

1190


What is extern storage class in c?

1001


When should I declare a function?

1148


Difference between Shallow copy and Deep copy?

2032


What is a constant and types of constants in c?

1140


Can include files be nested? How many levels deep can include files be nested?

1176


What is a global variable in c?

1020


What is a void pointer? When is a void pointer used?

1065


How many types of sorting are there in c?

1061


Explain bit masking in c?

1145


Write a program to swap two numbers without using the third variable?

1078


When should the volatile modifier be used?

1192