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 prime nums from 1-20 using c
programing?

Answer Posted / ankur mohan sharma

#include<stdio.h>
#include<conio.h>
int main()
{
int i,n;
for(n=2;n<=20;n++)
{
for(i=2;i<n;i++)
{if(n%i==0)
break;}
}
if(i==n)
printf("\n %d",n);
return 0;

}

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I manipulate individual bits?

995


What is the use of parallelize in spark?

987


Can stdout be forced to print somewhere other than the screen?

1020


What is #ifdef ? What is its application?

1059


What is variable initialization and why is it important?

1181


Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop

2116


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

2157


What is structure in c definition?

996


Write the Program to reverse a string using pointers.

980


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

1119


How can I remove the leading spaces from a string?

1104


Explain Function Pointer?

1112


What functions are in conio h?

1160


What are the different types of constants?

1031


Can include files be nested?

1065