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

#include<stdio.h>
#include<conio.h>
void main()
{
int m,flag;
flag=0;
for(int i=2;i<100;i++)
{
for(int j=1;j<i;j++)
{
if(i%j==0)
{flag++;
}
}
if(flag==2)
{printf("it is prime %d",i);
}

}
getch();
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I have seen function declarations that look like this

1093


Why do we write return 0 in c?

1128


What is putchar() function?

1219


List a few unconditional control statement in c.

1029


When should the volatile modifier be used?

1232


How arrays can be passed to a user defined function

1069


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

1287


How do we make a global variable accessible across files? Explain the extern keyword?

1936


What are the types of data types and explain?

1131


Why main function is special give two reasons?

1603


Write the syntax and purpose of a switch statement in C.

1150


Where is c used?

1154


Tell me about low level programming languages.

1190


Explain what are multidimensional arrays?

1122


Do character constants represent numerical values?

1398