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 / faizan n

/*A program to print all primes b\w 1-100*/
#include<stdio.h>
#include<conio.h>

void main()
{
int count,i=1;
int a;
int col=0;
clrscr();

for(i=1; i<101; i++)
{
count=0;
a=1;

while(a<=i)
{
if(i%a==0)
count++;
a++;
}

if(count==2)
{
printf("%d\t",i);
col++;
if(col%10==0)
printf("\n");
}

}
getch();
}

Is This Answer Correct ?    7 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are the variables argc and argv are local to main?

1270


What is a macro?

1058


int far *near * p; means

3512


How can I read a binary data file properly?

1101


Are global variables static in c?

1121


Explain about block scope in c?

1046


Explain threaded binary trees?

1119


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

2280


How is a null pointer different from a dangling pointer?

983


what are bit fields in c?

1620


What is build process in c?

1095


What is sizeof in c?

965


What is the use of a semicolon (;) at the end of every program statement?

1428


Can a variable be both static and volatile in c?

988


How does sizeof know array size?

1087