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

cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration

1108


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

1064


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

2301


What is static memory allocation?

1178


What is an arrays?

1076


Why isnt there a numbered, multi-level break statement to break out

1048


How is pointer initialized in c?

1024


What are different types of variables in c?

1070


what is reason of your company position's in india no. 1.

2334


What is a list in c?

1032


Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

1069


if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.

5236


What is a shell structure examples?

1101


If you know then define #pragma?

1104


In which layer of the network datastructure format change is done

1889