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 of advanced Fibonacci series.

1155


What is stack in c?

1084


Can we compile a program without main() function?

1131


How do you sort filenames in a directory?

1185


Can a pointer be static?

1090


What is bubble sort technique in c?

986


Difference between macros and inline functions? Can a function be forced as inline?

1278


How are portions of a program disabled in demo versions?

1298


What is pragma c?

1126


Why we write conio h in c?

1040


Tell me when would you use a pointer to a function?

1068


Explain how can a program be made to print the name of a source file where an error occurs?

1198


What are formal parameters?

1126


Why is c so powerful?

1119


What is bash c?

1014