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

Define circular linked list.

975


Explain what are compound statements?

993


What does the c preprocessor do?

1050


What is #include stdio h?

1060


Ow can I insert or delete a line (or record) in the middle of a file?

953


What is pivot in c?

974


Write a program to reverse a string.

1025


how many errors in c explain deply

2035


What are the __date__ and __time__ preprocessor commands?

1039


Do pointers store the address of value or the actual value of a variable?

1019


What is the size of a union variable?

999


What are pointers in C? Give an example where to illustrate their significance.

1166


What is a union?

988


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

1040


Explain the process of converting a Tree into a Binary Tree.

2607