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

What is array within structure?

1100


What is the difference between malloc() and calloc() function in c language?

1058


Write a program to reverse a given number in c?

1019


Which is better malloc or calloc?

1089


What is the difference between volatile and const volatile?

977


How can you check to see whether a symbol is defined?

1090


Are pointers integers in c?

1058


What is auto keyword in c?

1191


When was c language developed?

1181


What are pointers? What are stacks and queues?

1127


Explain how do I determine whether a character is numeric, alphabetic, and so on?

1124


What are the standard predefined macros?

1125


Why do we use pointer to pointer in c?

1068


Difference between Function to pointer and pointer to function

1054


What is indirection in c?

1056