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

What are the 4 data types?

1023


How many levels of pointers have?

1056


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

5957


Explain how do you override a defined macro?

1080


Why do we use static in c?

1137


What are dangling pointers in c?

1236


What are pointers? What are stacks and queues?

1155


Can stdout be forced to print somewhere other than the screen?

1049


What is function what are the types of function?

1000


What is meant by int main ()?

1212


What is the difference between functions abs() and fabs()?

1158


Can I initialize unions?

1045


What is the purpose of ftell?

1085


Why is c not oop?

980


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1726