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...

write the program for prime numbers?

Answer Posted / sreejesh1987

//Output primes upto limit n(Give n>2)
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
printf("\t\t\tPRIME NUMBERS\n");
printf("Enter n:");
scanf("%d",&n);
printf("\n\t2");
for(i=3;i<=n;i++)
for(j=2;j<i,i%j!=0;j++)
if(i-1==j)
printf("\n\t%d",i);
getch();
}

Is This Answer Correct ?    11 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to identify if a given binary tree is balanced or not.

1091


How can variables be characterized?

2129


What is a good data structure to use for storing lines of text?

1033


if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.

5142


Explain argument and its types.

993


Is printf a keyword?

1157


Explain About fork()?

1058


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1869


I have a varargs function which accepts a float parameter?

997


code for replace tabs with equivalent number of blanks

2100


#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }

1129


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

946


#include { printf("Hello"); } how compile time affects when we add additional header file .

1852


Where static variables are stored in memory in c?

948


What is the easiest sorting method to use?

1097