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 / m santhosh

int count=0;
int number=100; //// print Prime no's from 1 to 100
for(int i=1;i<=number;i++)
{
count=0;
for(int j=1;j<=i;j++)
{
if((i%j==0))
{
count++;
}

}
if(count<=2)
{
printf("\nPrime Number = %d",i);

}

}

Is This Answer Correct ?    14 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15821


Explain what is a stream?

1097


Where we use clrscr in c?

1141


Is this program statement valid? INT = 10.50;

1167


Explain indirection?

1147


what is the diffrenet bettwen HTTP and internet protocol

1841


Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.

1113


Why cant I open a file by its explicit path?

1038


What does it mean when a pointer is used in an if statement?

1113


Write a program to print fibonacci series using recursion?

1069


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

1120


How can you determine the maximum value that a numeric variable can hold?

1239


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1039


what do the 'c' and 'v' in argc and argv stand for?

1176


Why ca not I do something like this?

1018