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 language is lisp written in?

1271


What are file streams?

1020


What does a function declared as pascal do differently?

1140


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

1005


FILE PROGRAMMING

2248


What is structure and union in c?

1154


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

2189


the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above

1055


What is New modifiers?

1131


cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration

1110


In C language what is a 'dangling pointer'?

1163


Where are c variables stored in memory?

1077


Where is volatile variable stored?

1091


write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

2139


What is data type long in c?

1078