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

Describe dynamic data structure in c programming language?

1062


Is null always equal to 0(zero)?

1010


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

2150


How can I write functions that take a variable number of arguments?

1097


What is the time and space complexities of merge sort and when is it preferred over quick sort?

1034


What does sizeof int return?

1036


Why doesnt the call scanf work?

1153


Why we write conio h in c?

990


Explain what is wrong with this program statement?

1086


What is meant by inheritance?

1065


What is the use of define in c?

1025


Explain setjmp()?

1033


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2586


What is the description for syntax errors?

1110


Why c is known as a mother language?

1055