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
What is extern storage class in c?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
what will be the output for the following main() { printf("hi" "hello"); }
Can you please explain the scope of static variables?
What is the purpose of & in scanf?
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
What is the difference between union and structure in c?
What is c token?
Is there anything like an ifdef for typedefs?
What is #line?
What is sizeof int?
What are the primitive data types in c?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
What is the advantage of c?
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)