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 / shailesh singh

#include<stdio.h>
#include<conio.h>
void main()
{
int flag,x;
clrscr();
printf("2\t");
for(int i=3;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 ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why are algorithms important in c program?

1067


What is a example of a variable?

949


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

1052


Is it possible to initialize a variable at the time it was declared?

1172


Is a pointer a kind of array?

1113


Is there a built-in function in C that can be used for sorting data?

1179


What is hashing in c language?

1185


When c language was developed?

1010


What is the difference between struct and union in C?

1240


What is the difference between fread and fwrite function?

1033


Why is it that not all header files are declared in every C program?

1143


Why is c so important?

994


What is the c value paradox and how is it explained?

991


#include #include struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.

6187


What is meant by inheritance?

1047