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 / prasad avunoori

int s=0;
int c,k;
for (int i = 2; i < 100; i++)

{
c = 0;
for (int j = 1; j <= i; j++)

{
if(i%j==0)
{
c = c + 1;

}

}
if (c == 2)
{

printf("%d\n",i);
s++;

}


} printf("There are %d " ,s);

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is null always defined as 0(zero)?

1124


Explain how do you print an address?

1154


What is operator precedence?

1221


What is a macro?

1122


What is the difference between the expression “++a” and “a++”?

1241


explain how do you use macro?

1168


What are structures and unions? State differencves between them.

1190


What are the types of type qualifiers in c?

1094


Write a program with dynamically allocation of variable.

1147


What is boolean in c?

1099


What is dynamic dispatch in c++?

1076


What is the function of volatile in c language?

1147


What is the meaning of typedef struct in c?

1073


Write a program to print "hello world" without using a semicolon?

1072


What are the ways to a null pointer can use in c programming language?

1148