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
When should structures be passed by values or by references?
an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational
What is structure and union in c?
What is exit() function?
Can you tell me how to check whether a linked list is circular?
What is the size of enum in bytes?
What is the purpose of clrscr () printf () and getch ()?
What is difference between structure and union in c?
string reverse using recursion
Explain about block scope in c?
write a program to find the given number is prime or not
how many key words availabel in c a) 28 b) 31 c) 32
how to build a exercise findig min number of e heap with list imlemented?
Compare interpreters and compilers.
Can a pointer point to null?