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

#include<stdio.h>
#include<conio.h>
void main()
{
int flag,x;
clrscr();
printf("1\t");
for(int i=1;i<=100;i++)
{
flag=0;
for(x=2;x<=i;x++)
{
if(i%x==0)
{
flag=1;
break;
}
else
continue;
}
if(i==x)
printf("%d\t",i);
}
getch();
}

Is This Answer Correct ?    48 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we add pointers together?

1001


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

1200


How are portions of a program disabled in demo versions?

1235


How can I find the modification date and time of a file?

1030


`write a program to display the recomended action depends on a color of trafic light using nested if statments

2077


What are two dimensional arrays alternatively called as?

1136


Why c is called top down?

1096


What is a dynamic array in c?

1078


Is that possible to store 32768 in an int data type variable?

1038


Differentiate between full, complete & perfect binary trees.

1055


Is c easier than java?

1001


Write the test cases for checking a variable having value in range -10.0 to +10.0?

2271


Differentiate between new and malloc(), delete and free() ?

1136


What is pivot in c?

976


What are Macros? What are its advantages and disadvantages?

1094