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 a program to print all the prime numbers with in the
given range

Answer Posted / pooja mishra

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int range,c;
cout<<"enter the range";
cin>>range;
for(int i=1;i<=range;i++)
{
c=0;
for(int j=2;j<i;j++)
{
if(i%j==0)
c++;
}
if(c==o)
cout<<i<<"\n";
}
getch();
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why clrscr is used in c?

1065


What is the meaning of typedef struct in c?

1120


hi send me sample aptitude papers of cts?

2222


What is typedf?

1169


What is binary tree in c?

1138


What is #line used for?

1074


What do you mean by command line argument?

1231


What is nested structure?

1100


What is c language and why we use it?

1127


Is there a way to switch on strings?

1134


Why static variable is used in c?

1089


Explain what is output redirection?

1250


Why we not create function inside function.

2255


Explain what is a stream?

1145


What is atoi and atof in c?

1143