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

#include<stdio.h>
main()
{
int i,j;
for(i=2;i<=20;i++)
{
c=1;
for(j=2;j<i;j++)
{
if(i%j==0)
c=0;
}
if(c==1)
printf("%d",i);
}
}

Is This Answer Correct ?    46 Yes 21 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention four important string handling functions in c languages .

1060


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

2846


What are the different categories of functions in c?

1107


What is a pragma?

1091


Do you know the use of fflush() function?

1024


What is the sizeof () operator?

1039


write a program to find the given number is prime or not

4681


How can I sort a linked list?

1004


How can you draw circles in C?

1110


How many bytes are occupied by near, far and huge pointers (dos)?

1131


Explain what is the advantage of a random access file?

1082


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

1186


What is oops c?

1144


What is the function of volatile in c language?

1086


1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.

2768