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 / deva

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

for(i=2;i<100;i++)
{

for( j=2;j<i;j++)
{
if(i%j==0)
count++;

}
if (count==0)
printf("%d\t",i);
count=0;
}

}

Is This Answer Correct ?    22 Yes 37 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does a pointer variable always consist of?

1104


Why can arithmetic operations not be performed on void pointers?

1047


What is actual argument?

1067


What is structure padding and packing in c?

1074


Do you know what are bitwise shift operators in c programming?

1106


Why does everyone say not to use scanf? What should I use instead?

1424


What is data structure in c programming?

1083


Write a program to reverse a string.

1086


Explain how do you sort filenames in a directory?

1043


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

1090


How will you find a duplicate number in a array without negating the nos ?

2136


What is file in c preprocessor?

1155


How can you tell whether a program was compiled using c versus c++?

1110


Explain the use of fflush() function?

1086


What is table lookup in c?

1103