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

What is union in c?

1164


Implement bit Array in C.

1199


How will you declare an array of three function pointers where each function receives two ints and returns a float?

1431


Explain what will the preprocessor do for a program?

1111


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1153


Write a program to print fibonacci series without using recursion?

1218


A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

2175


What is the use of static variable in c?

1142


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

1992


application attempts to perform an operation?

2033


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

1305


How will you delete a node in DLL?

1338


Place the #include statement must be written in the program?

1086


Write a program to generate random numbers in c?

1156


Explain how can I convert a number to a string?

1205