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

Write a code on reverse string and its complexity.

1034


What is equivalent to ++i+++j?

1089


Explain the priority queues?

1074


WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

2379


my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?

1586


how logic is used

1966


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

2135


write a program to rearrange the array such way that all even elements should come first and next come odd

2275


Which is better between malloc and calloc?

1198


What is the difference between typedef struct and struct?

1109


What is difference between structure and union?

1128


What is the difference between NULL and NUL?

1290


Why is %d used in c?

1006


What is #line in c?

1014


Does sprintf put null character?

1042