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

code for replace tabs with equivalent number of blanks

2108


what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values

1661


There seem to be a few missing operators ..

1016


What is the process to create increment and decrement stamen in c?

1014


Is c language still used?

950


swap 2 numbers without using third variable?

1089


What is the most efficient way to store flag values?

1143


What is pragma c?

1073


What are 3 types of structures?

1039


What is s or c?

1025


What is the advantage of an array over individual variables?

1198


Can a pointer be volatile in c?

950


What do you mean by dynamic memory allocation in c?

1064


Can an array be an Ivalue?

1066


What are valid signatures for the Main function?

1188