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

What is the mean of function?

1136


What are the 5 data types?

1145


What is indirection in c?

1075


What is main return c?

1004


Explain high-order and low-order bytes.

1107


What are the two types of structure?

1093


To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9

2642


What are the characteristics of arrays in c?

1054


Why header file is used in c?

1097


Explain the use of fflush() function?

1085


What is sizeof int in c?

1064


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

1976


What is a c token and types of c tokens?

1069


What is strcpy() function?

1171


What is I ++ in c programming?

1123