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 an expression?

998


What is the difference between abs() and fabs() functions?

1058


What does & mean in scanf?

1042


Why isnt there a numbered, multi-level break statement to break out

993


What are the types of functions in c?

928


What is sorting in c plus plus?

921


Explain how can you determine the size of an allocated portion of memory?

1033


Can you please compare array with pointer?

1024


Where does the name "C" come from, anyway?

1074


Why malloc is faster than calloc?

1010


Why is python slower than c?

1016


Explain is it valid to address one element beyond the end of an array?

1147


Describe static function with its usage?

1151


What is the use of ?

990


the question is that what you have been doing all these periods (one year gap)

2017