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

Here is a good puzzle: how do you write a program which produces its own source code as output?

1032


What is null pointer in c?

944


What is class and object in c?

1044


What is floating point constants?

1079


what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above

1070


What is meant by operator precedence?

1095


What oops means?

928


Is that possible to add pointers to each other?

1314


What is define c?

997


Write a program with dynamically allocation of variable.

1064


A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(

2199


Difference between Shallow copy and Deep copy?

1966


What are the 5 types of inheritance in c ++?

958


What is string concatenation in c?

1022


What is #include conio h?

939