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

Can you write the function prototype, definition and mention the other requirements.

1105


What is volatile variable in c with example?

1012


Explain the difference between the local variable and global variable in c?

1044


Explain the difference between malloc() and calloc() function?

1007


Explain how can you be sure that a program follows the ansi c standard?

1432


What is a program?

1217


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

1019


What does printf does?

1210


What is an endless loop?

1251


Explain how to reverse singly link list.

1101


Differentiate between the = symbol and == symbol?

1242


Is there any data type in c with variable size?

1061


Which driver is a pure java driver

1561


Write a program to print factorial of given number without using recursion?

971


How to delete a node from linked list w/o using collectons?

2746