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
Write the test cases for checking a variable having value in range -10.0 to +10.0?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
Explain two-dimensional array.
What kind of structure is a house?
What are the 4 types of organizational structures?
When should we use pointers in a c program?
What is meant by 'bit masking'?
What are pointers really good for, anyway?
How pointers are declared?
What is difference between function overloading and operator overloading?
What language is c written?
Do you know the difference between malloc() and calloc() function?
Can you write the algorithm for Queue?
the question is that what you have been doing all these periods (one year gap)
What is the 'named constructor idiom'?