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

Explain the use of 'auto' keyword in c programming?

1126


What is && in c programming?

1175


Why & is used in scanf in c?

1109


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

1094


How can I copy just a portion of a string?

1319


How many bytes is a struct in c?

1177


What is n in c?

1070


How can I recover the file name given an open stream?

1035


Which function in C can be used to append a string to another string?

1226


What is difference between far and near pointers?

1060


Explain what does it mean when a pointer is used in an if statement?

1076


i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical

2334


What are the different types of constants?

1080


int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above

1310


Can you write the algorithm for Queue?

2128