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

Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)

1160


Are there any problems with performing mathematical operations on different variable types?

1041


Write a program to print “hello world” without using semicolon?

1124


c program to compute AREA under integral

2408


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

1162


Why array is used in c?

1019


which is an algorithm for sorting in a growing Lexicographic order

1810


Is c dynamically typed?

1165


In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?

1232


explain what are pointers?

1021


What are the different types of objects used in c?

1034


number of times a digit is present in a number

2040


What is the difference between near, far and huge pointers?

1099


What are the functions to open and close the file in c language?

1041


write a program in c language to print your bio-data on the screen by using functions.

6789