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
How can I remove the leading spaces from a string?
What are the different types of pointers used in c language?
What are the features of c languages?
What is meant by preprocessor in c?
#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }
Why do we write return 0 in c?
hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel
Did c have any year 2000 problems?
What is the role of this pointer?
Can I initialize unions?
Explain enumerated types in c language?
Explain how can you tell whether two strings are the same?
Explain how can I prevent another program from modifying part of a file that I am modifying?
What is the significance of an algorithm to C programming?
What is array within structure?