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 many errors in c explain deply

2138


how to build a exercise findig min number of e heap with list imlemented?

2127


What are the applications of c language?

1124


What is static volatile in c?

1077


What are the differences between Structures and Arrays?

1273


When we use void main and int main?

1130


string reverse using recursion

2533


Write a factorial program using C.

1122


Define VARIABLE?

1236


What are the uses of a pointer?

1199


What is the maximum length of an identifier?

1231


What is pre-emptive data structure and explain it with example?

3789


Is it fine to write void main () or main () in c?

1077


Is flag a keyword in c?

1216


number of times a digit is present in a number

2081