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

Write a program to print all permutations of a given string.

1130


Explain what is a stream?

1035


Explain what is a const pointer?

1039


What are void pointers in c?

969


write a c program to calculate sum of digits till it reduces to a single digit using recursion

3250


Explain enumerated types.

979


Find MAXIMUM of three distinct integers using a single C statement

1015


what is recursion in C

1023


What is the difference between ā€˜g’ and ā€œgā€ in C?

3913


write a program to display all prime numbers

1914


diff between exptected result and requirement?

1994


What is the difference between Printf(..) and sprint(...) ?

1432


Is array name a pointer?

999


Write a code to remove duplicates in a string.

986


Mention four important string handling functions in c languages .

1054