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

#include<stdio.h>
#include<conio.h>
main()
{
int flag,i,j;
clrscr();
for(i=1;i<=100;i++)
{
flag=0;
for(j=2;j<=i;j++)
{
if(i%j==0)
{
flag++;
}
}
if(flag==1)
printf("%d\t",i);
}
getch();
}

Is This Answer Correct ?    2 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is oops c?

1339


What is n in c?

1109


What header files do I need in order to define the standard library functions I use?

1118


What is the difference between ++a and a++?

1271


#include { printf("Hello"); } how compile time affects when we add additional header file .

1939


What is a void * in c?

1134


Explain what is wrong with this statement? Myname = ?robin?;

1637


What are the disadvantages of external storage class?

1103


How many types of errors are there in c language? Explain

1022


What is the scope of global variable in c?

1033


What is function in c with example?

1229


What is pointer in c?

1247


hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .

2508


What does volatile do?

1035


If I have a char * variable pointing to the name of a function ..

1227