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...

Please write me a program to print the first 50 prime
numbers (NOT between the range 1 -50)

Answer Posted / azad sable, chiplun

void main()
{
int i,n=1;
clrscr();
printf("\nprime no. between 1 to50 are:\n1\t);
while(n<=50)
{
i=2;
while(i<n)
{
if(n%1==0)
break;
else
i++;
}
if(i==n)
printf("%d\t",n);
n++;
}
getch();
}

Is This Answer Correct ?    20 Yes 34 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are pragmas and what are they good for?

936


What is pointer in c?

1143


Is printf a keyword?

1159


Explain what is a pragma?

996


What is static and volatile in c?

1177


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

2718


What is ctrl c called?

1003


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

980


Write the syntax and purpose of a switch statement in C.

1043


What is an identifier?

979


What is difference between arrays and pointers?

1017


Can you write the function prototype, definition and mention the other requirements.

1086


What is echo in c programming?

967


What are keywords c?

985


Explain what header files do I need in order to define the standard library functions I use?

1118