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

//Ha Ha I'm the creator of shortest code
//for prime numbers
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
printf("\t\t\tPRIME NUMBERS 1-20\n");
printf("\n\t2");
for(i=3;i<=20;i++)
for(j=2;j<i,i%j!=0;j++)
if(i-1==j)
printf("\n\t%d",i);
getch();
}

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write the test cases for checking a variable having value in range -10.0 to +10.0?

2322


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

1154


Explain two-dimensional array.

1086


What kind of structure is a house?

1048


What are the 4 types of organizational structures?

1110


When should we use pointers in a c program?

1146


What is meant by 'bit masking'?

1394


What are pointers really good for, anyway?

1067


How pointers are declared?

965


What is difference between function overloading and operator overloading?

1096


What language is c written?

1058


Do you know the difference between malloc() and calloc() function?

1072


Can you write the algorithm for Queue?

2127


the question is that what you have been doing all these periods (one year gap)

2092


What is the 'named constructor idiom'?

1100