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 / shailesh singh

#include<stdio.h>
#include<conio.h>
void main()
{
int flag,x;
clrscr();
printf("2\t");
for(int i=3;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 ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sizeof int in c?

1054


What is the difference between the local variable and global variable in c?

960


what is the syallabus of computer science students in group- 1?

2315


What is an lvalue?

1063


A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler

1088


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

1250


What is data structure in c and its types?

1068


What is c preprocessor mean?

1306


Where can I get an ansi-compatible lint?

1143


Is stack a keyword in c?

1078


Why is event driven programming or procedural programming, better within specific scenario?

2420


What is the purpose of type declarations?

1114


FILE PROGRAMMING

2229


What is a node in c?

971


Which one would you prefer - a macro or a function?

1074