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 / ali

#include<iostream.h>
#include<conio.h>


int main ()
{
for (int i=2; i<100; i++)
for (int j=2; j<i; j++)
{
if (i % j == 0)
break;
else if (i == j+1)
cout << i << "\t";

}
getch();
}

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are local static variables?

1154


What is difference between main and void main?

1214


What is an lvalue in c?

1127


What is a function simple definition?

1097


How can I manipulate individual bits?

1043


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

1026


What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers

1259


Is null valid for pointers to functions?

1174


What is wrong in this statement? scanf(ā€œ%dā€,whatnumber);

1245


what are the advantages of a macro over a function?

1146


What is #include conio h?

1002


Here is a neat trick for checking whether two strings are equal

1022


Can we use any name in place of argv and argc as command line arguments?

1075


Why clrscr is used in c?

1016


Is fortran faster than c?

1046