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

#include<stdio.h>
#include<conio.h>
void main()
{
int m,flag;
printf("enter the numbers upto which you wannt to find the prime numbers :");
scanf("%d",&m);
for(int i=1;i<=m;i++)
{
flag=1;
for(int j=2;j<=i/2;j++)
{
if(i%j==0)
flag=0;
}
if(flag==1)
printf("\n%d",i);
}
getch();
}


thank u

Is This Answer Correct ?    49 Yes 24 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

p*=(++q)++*--p when p=q=1 while(q<=6)

1756


Does sprintf put null character?

1038


What is output redirection?

1213


What is scope rule in c?

1061


Can one function call another?

1112


What is calloc in c?

1139


What is static volatile in c?

1019


What are the similarities between c and c++?

1066


Do you know what are the properties of union in c?

1077


What does %c do in c?

985


Explain the use of bit fieild.

1137


find the sum of two matrices and WAP for it.

1134


Write a program to use switch statement.

1128


What are the benefits of organizational structure?

1020


Is c easier than java?

1069