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

What is the value of uninitialized variable in c?

980


What are conditional operators in C?

1053


a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor

1036


Write a program to generate random numbers in c?

1053


What is array within structure?

1066


why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above

1033


The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

1147


What do you know about the use of bit field?

992


What is the most efficient way to count the number of bits which are set in an integer?

1005


What is signed and unsigned?

1017


Explain how do you convert strings to numbers in c?

1025


Is c# a good language?

966


#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }

1071


How can my program discover the complete pathname to the executable from which it was invoked?

1039


how could explain about job profile

1862