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 difference between int main and void main in c?

1091


What are predefined functions in c?

1018


When c language was developed?

1007


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1152


How can I implement sets or arrays of bits?

987


Explain the process of converting a Tree into a Binary Tree.

2607


Is c high or low level?

958


What is int main () in c?

1024


What is a union?

977


What are the different types of linkage exist in c?

971


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1622


Why structure is used in c?

1107


What are the types of variables in c?

977


What is #include stdlib h?

1055


Why do we use stdio h and conio h?

1030