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 / santhi perumal

#include<Stdio.h>
#include<conio.h>

int main()
{
int i,j, flag = 0;

for(i=2;i<=100;i++)
{
for(j=2;j<i;j++)
{
if(i != j)
{
if(i%j != 0)
continue;
else
break;
}
}
if(i == j)
printf("%d ",i);

}
}

Is This Answer Correct ?    52 Yes 38 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is different between auto and local static? why should we use local static?

1128


What is a ternary operator in c?

1127


What is the sizeof () a pointer?

998


What is a MAC Address?

1066


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2076


If null and 0 are equivalent as null pointer constants, which should I use?

1225


What does c mean before a date?

1184


Explain spaghetti programming?

1263


With the help of using classes, write a program to add two numbers.

1044


What is the difference between new and malloc functions?

1132


Explain what does the format %10.2 mean when included in a printf statement?

1367


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2749


How to get string length of given string in c?

1068


Dont ansi function prototypes render lint obsolete?

1136


Why we use int main and void main?

1084