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

#include<stdio.h>


void main()
{
int count=0;
int num=1;
int i;

printf("prime nums \n");
while(count<50)
{
num++;
for (i=2;i<=num-1;i)
{
if(num%i==0)break;
i++;
}
if(i>=num-1)
{
printf("%d ",num);
count++;
}

}
}

Is This Answer Correct ?    93 Yes 47 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is stack in c?

1031


What is typedf?

1069


What is the mean of function?

1066


Explain data types & how many data types supported by c?

1027


How do I read the arrow keys? What about function keys?

1021


Does sprintf put null character?

990


What is the correct declaration of main?

1156


Is null equal to 0 in sql?

1092


How can you draw circles in C?

1100


What is sizeof int in c?

1005


Why do we need functions in c?

958


how to build a exercise findig min number of e heap with list imlemented?

2021


Can a pointer be null?

978


How can I invoke another program or command and trap its output?

1049


What do you know about the use of bit field?

990