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

Why dont c comments nest?

1052


What is the meaning of typedef struct in c?

1072


What is character set?

1172


What is bash c?

1013


What is a memory leak? How to avoid it?

1351


Explain which function in c can be used to append a string to another string?

1092


How can type-insensitive macros be created?

1171


code for replace tabs with equivalent number of blanks

2167


write a program to find the given number is prime or not

4772


how is the examination pattern?

2025


What is #include cctype?

1126


How can you tell whether a program was compiled using c versus c++?

1110


What is c definition?

1279


What is the sizeof () operator?

1088


Why main function is special give two reasons?

1548