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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you override a defined macro?

1216


Is there any data type in c with variable size?

1047


What is assert and when would I use it?

972


What is string constants?

1113


What is identifier in c?

975


what value is returned to operating system after program execution?

2077


Is boolean a datatype in c?

1020


Explain data types & how many data types supported by c?

1035


How to find a missed value, if you want to store 100 values in a 99 sized array?

1374


What does malloc () calloc () realloc () free () do?

1015


Explain the properties of union.

1032


Write a program to reverse a linked list in c.

1080


What are the different types of data structures in c?

1126


What is the total generic pointer type?

1120


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

1093