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

How many bytes is a struct in c?

1166


What is this pointer in c plus plus?

1088


Why is not a pointer null after calling free?

1021


Define VARIABLE?

1164


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1088


What are formal parameters?

1117


What is infinite loop?

1084


What is the difference between NULL and NUL?

1290


How important is structure in life?

1083


Does c have function or method?

996


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

1258


What is difference between structure and union with example?

1057


Is linux written in c?

1039


the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset

1104


code for replace tabs with equivalent number of blanks

2162