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 / siva

#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 ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to generate the Fibinocci Series

1245


What are valid operations on pointers?

1211


develop algorithms to add polynomials (i) in one variable

2177


What is the use of bitwise operator?

1134


What are header files why are they important?

1096


Are there any problems with performing mathematical operations on different variable types?

1046


What is the purpose of type declarations?

1122


What is the difference between #include and #include 'file' ?

1070


Explain what are run-time errors?

1099


What is wrong with this initialization?

1015


Is exit(status) truly equivalent to returning the same status from main?

1077


shorting algorithmS

2262


what is the structure pointer?

2133


Who is the main contributor in designing the c language after dennis ritchie?

1012


Why calloc is better than malloc?

1046