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 print the prime numbers from 1 to 100?

Answer Posted / aravind

#include<stdio.h?
int main()
{
int i,count=0;
for(i=1;i<=100;i++)
{
a=i%10;
if(a==0)
{
count++;
if(count<=2)
printf("the prime numbers are %d",i);
}
else
count=count;
}

the above answer is good but it will not print 1 as prime.

Is This Answer Correct ?    14 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the easiest sorting method to use?

1144


How can you determine the size of an allocated portion of memory?

1288


How can I get the current date or time of day in a c program?

1208


How can I sort a linked list?

1030


What is sizeof array?

1041


#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??

1939


Can a variable be both static and volatile in c?

1019


Explain which function in c can be used to append a string to another string?

1074


why return type of main is not necessary in linux

2091


Why use int main instead of void main?

1109


What is nested structure?

1029


What is difference between array and pointer in c?

1077


What is the -> in c?

997


while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above

1221


Who is the founder of c language?

1150