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 local static variables? How can you use them?

1154


What is the value of uninitialized variable in c?

1037


provide an example of the Group by clause, when would you use this clause

2201


Write a program to know whether the input number is an armstrong number.

1131


Is c compiled or interpreted?

1202


What are types of structure?

1130


What is wrong with this program statement? void = 10;

1264


The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this

3584


Is c call by value?

1026


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

1107


What are the types of i/o functions?

1349


Is this program statement valid? INT = 10.50;

1167


Explain what happens if you free a pointer twice?

1093


In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.

1856


a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none

1171