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

How do you determine a file’s attributes?

1014


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

1046


When is a null pointer used?

1060


an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational

1257


What is a stream?

1078


Why is c platform dependent?

1019


What is the use of getchar() function?

1070


how to execute a program using if else condition and the output should enter number and the number is odd only...

2203


What are the advantages of the functions?

1094


An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

1087


What is the scope of global variable in c?

947


When would you use a pointer to a function?

992


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

1014


Explain how do you print an address?

1084


List the variables are used for writing doubly linked list program.

1965