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;
cout<<"enter a no";
cin>>no;
for(i=2;i<no;i++)
{
r=no%i;
if(r==0)
{
p==0;
break;
}}
if(p==1)
{
cout<<"prime no";
}
else
{
cout<<"note prime";
}
getch();
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are data types in c language?

1057


What is enumerated data type in c?

1077


What is c basic?

1168


Why do we need a structure?

1037


Why is c known as a mother language?

1239


In a header file whether functions are declared or defined?

1126


Which one would you prefer - a macro or a function?

1081


What are enums in c?

1200


How to set file pointer to beginning c?

1203


What is optimization in c?

1001


What is union and structure in c?

1219


Why is not a pointer null after calling free?

1019


What is the general form of #line preprocessor?

991


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

1204


What does double pointer mean in c?

1173