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 dispaly upto 100 prime numbers(without
using Arrays,Pointer)

Answer Posted / bobby shankar

///Prime Number between 1 to n number
int Prime(int init ,int final)
{
int i;
while(init <= final)
{
i=2;
while(i<init)
{
if(init%i==0)
break;
i++;
}
if(i==init)
printf("\n %d is Prime number",init);
init++;
}
}
int main()
{
int inital,final;
printf("\n Enter your Range followed by space separater
e.g 3 30 : ");
scanf("%d %d",&inital,&final);
Prime(inital,final);
getch();
return 1;
}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

List out few of the applications that make use of Multilinked Structures?

2187


Array is an lvalue or not?

1121


What is the difference between constant pointer and constant variable?

1222


What are the types of data files?

1199


When should the volatile modifier be used?

1170


What is %g in c?

1078


Explain what does the format %10.2 mean when included in a printf statement?

1360


Where we use clrscr in c?

1131


what are # pragma staments?

2041


Do array subscripts always start with zero?

1297


What are loops in c?

997


When should a type cast be used?

1010


How can I implement a delay, or time a users response, with sub-second resolution?

1073


What are qualifiers in c?

1032


What is volatile variable in c?

1089