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 a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)

Answer Posted / abhay

#include<stdio.h>
#include<conio.h>
void main()
{
int flag,x;
clrscr();
printf("1\t");
for(int i=1;i<=100;i++)
{
flag=0;
for(x=2;x<=i;x++)
{
if(i%x==0)
{
flag=1;
break;
}
else
continue;
}
if(i==x)
printf("%d\t",i);
}
getch();
}

Is This Answer Correct ?    291 Yes 108 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is s in c?

997


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

958


What is getch?

1089


What is operator precedence?

1150


What is return type in c?

1075


What is the benefit of using #define to declare a constant?

1044


What’s a signal? Explain what do I use signals for?

1054


What are the valid places to have keyword “break”?

1039


write a program for the normal snake games find in most of the mobiles.

2215


Can we increase size of array in c?

922


What is conio h in c?

1002


When is a “switch” statement preferable over an “if” statement?

1072


What is the difference between array_name and &array_name?

1240


What do you mean by Recursion Function?

1070


Is flag a keyword in c?

1109