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 are the types of variables in c?

1017


Is there sort function in c?

1009


What is const and volatile in c?

1044


What does the && operator do in a program code?

1214


How can you access memory located at a certain address?

1112


What standard functions are available to manipulate strings?

1144


What is nested structure in c?

1058


What happens if you free a pointer twice?

1064


What is a program?

1249


How can I open files mentioned on the command line, and parse option flags?

1068


Is c still used?

1043


Once I have used freopen, how can I get the original stdout (or stdin) back?

1072


Explain what is page thrashing?

1089


What is the purpose of sprintf() function?

1110


Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

1088