Write a program to print prime nums from 1-20 using c
programing?
Answer Posted / dinesh
#include<stdio.h>
main()
{
int i,j;
for(i=2;i<=20;i++)
{
c=1;
for(j=2;j<i;j++)
{
if(i%j==0)
c=0;
}
if(c==1)
printf("%d",i);
}
}
Is This Answer Correct ? | 46 Yes | 21 No |
Post New Answer View All Answers
can any one provide me the notes of data structure for ignou cs-62 paper
How can you check to see whether a symbol is defined?
Explain the binary height balanced tree?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
What is the difference between printf and scanf in c?
What is the difference between the expression “++a” and “a++”?
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);
When c language was developed?
which is an algorithm for sorting in a growing Lexicographic order
Explain what is gets() function?
What is #include called?
What is the difference between array and pointer?
What is actual argument?
What is the deal on sprintf_s return value?
Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?