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

#include<stdio.h>
#include<conio.h>
int main()
{
int num,n,div,p;
printf("Enter any number: ");
scanf("%d", &num);
for(n=2; n<=num; n++)
{
for(div=2; div<n; div++)
{
if(n%div==0)
{
p=0;
break;
}
p=1;
}
if(p)
printf("\t%d",n);
}
getch();
return 0;
}

Is This Answer Correct ?    8 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to check armstrong number in c?

1083


What is ambagious result in C? explain with an example.

2553


what value is returned to operating system after program execution?

2067


What is typedf?

1069


i got 75% in all semester am i eligible for your company

2174


If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above

1001


Why c is called free form language?

972


How can I automatically locate a programs configuration files in the same directory as the executable?

1106


Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1113


write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1

3860


Explain how do you generate random numbers in c?

1044


How do I read the arrow keys? What about function keys?

1021


while initialization of array why we use a[][2] why not a[2][]...?

2307


Is c still relevant?

1037


What is c system32 taskhostw exe?

979