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

What is auto keyword in c?

1172


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1229


write a proram to reverse the string using switch case?

2905


What is a class c rental property?

1061


write a program fibonacci series and palindrome program in c

994


Is javascript written in c?

1034


When should a type cast be used?

977


What is null in c?

1025


What is a constant?

1010


What is a pointer in c?

1458


Is there a way to switch on strings?

1048


Why can't I perform arithmetic on a void* pointer?

1065


what are the different storage classes in c?

1140


What is function in c with example?

1100


What is static function in c?

1078