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 / pirya

#include<stdio.h>
#include<conio.h>
void main()
{
int count==0,n=0,i=1,j=1;
clrscr();
while(n<50)
{
j=1;
count=0;
while(j<=1)
{
if(count%i==0)
count++;
j++;
}
if(count==2)
{
printf("%d ",i);
n++;
}
i++;
}
getch();
}

Is This Answer Correct ?    13 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

1199


What are compound statements?

1174


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

1014


How can you increase the allowable number of simultaneously open files?

1160


What is time complexity c?

994


What are dangling pointers? How are dangling pointers different from memory leaks?

1312


Is main an identifier in c?

1144


What is the purpose of sprintf() function?

1124


Explain pointer. What are function pointers in C?

1076


program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)

2096


What does struct node * mean?

1016


What is formal argument?

1134


Why does everyone say not to use scanf? What should I use instead?

1422


What is the difference between arrays and pointers?

1128


What is clrscr in c?

1136