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

What is the scope of static variable in c?

1078


How can you increase the allowable number of simultaneously open files?

1210


Explain how can you be sure that a program follows the ansi c standard?

1542


How can I open a file so that other programs can update it at the same time?

1238


How is = symbol different from == symbol in c programming?

1105


Why do we use pointer to pointer in c?

1138


Differentiate call by value and call by reference?

1027


How will you print TATA alone from TATA POWER using string copy and concate commands in C?

1423


What is n in c?

1112


HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2747


Write a progarm to find the length of string using switch case?

2123


Between macros and functions,which is better to use and why?

2319


What is the purpose of clrscr () printf () and getch ()?

1112


What does double pointer mean in c?

1258


Write a program to check whether a number is prime or not using c?

1109