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

a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler

1074


i want to know the procedure of qualcomm for getting a job through offcampus

2468


What are bitwise shift operators in c programming?

1076


Write a program to generate random numbers in c?

1095


The file stdio.h, what does it contain?

1154


How can I read/write structures from/to data files?

971


How does struct work in c?

1081


What is the difference between #include

and #include “header file”?

1027


What is c programming structure?

1186


What does the c in ctime mean?

1087


What is data structure in c programming?

1075


What do you mean by dynamic memory allocation in c? What functions are used?

1161


Is there any possibility to create customized header file with c programming language?

1064


how to print the character with maximum occurence and print that number of occurence too in a string given ?

2464


is it possible to create your own header files?

1103