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

What is #ifdef ? What is its application?

1112


What is a structure in c language. how to initialise a structure in c?

1067


What is a dynamic array in c?

1162


Why is this loop always executing once?

1061


How can I call fortran?

1049


Differentiate between Macro and ordinary definition.

1388


What is integer constants?

1085


Write a program on swapping (100, 50)

1131


How was c created?

1069


Can we use any name in place of argv and argc as command line arguments?

1077


Is a house a shell structure?

1165


What oops means?

1004


What are types of structure?

1121


What is n in c?

1061


What is pass by reference in c?

1188