Write a program to print prime nums from 1-20 using c
programing?
Answer Posted / bheem rao
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,count=0;
for(i=2;i<=20;i++)
{
for(j=1;j<=i;i++)
{
if(i%j==0)
count++;
}
if(count==2)
printf("%d\n",i);
count=0;
}
}
Is This Answer Correct ? | 12 Yes | 8 No |
Post New Answer View All Answers
What is a null pointer in c?
Write a program to reverse a linked list in c.
Why doesn't C support function overloading?
What are the different types of pointers used in c language?
How the c program is executed?
What are the data types present in c?
What is the use of printf() and scanf() functions?
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
Is main an identifier in c?
What is the difference between #include
Why main is not a keyword in c?
How are portions of a program disabled in demo versions?
What is LINKED LIST? How can you access the last element in a linked list?
Is it valid to address one element beyond the end of an array?
Why is C language being considered a middle level language?