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

#include<stdio.h>
#include<conio.h>
main()
{
int loop_counter,count_prime=1,divisor;
clrscr();
loop_counter=51; //it will exclude all less then 50
while(count_prime!=50)
{
for(divisor=2;divisor<=loop_counter-1;divisor++)
{
if (loop_counter % divisor==0)
{ break;
}
}
if(loop_counter==divisor)
{
printf("\n%d",loop_counter);
count_prime++;
}
loop_counter++;
}
getch();
}

Is This Answer Correct ?    8 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are file streams?

964


write a program to copy the string using switch case?

2842


Why do we use pointer to pointer in c?

1020


simple program of graphics and their output display

1937


Is null always defined as 0(zero)?

1041


What is the size of array float a(10)?

1091


What is anagram in c?

874


How can I invoke another program (a standalone executable, or an operating system command) from within a c program?

1130


How can you draw circles in C?

1098


we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?

1207


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1154


What is #include conio h?

944


How is a macro different from a function?

1117


What is string in c language?

1074


What are structures and unions? State differencves between them.

1099