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
How do you determine the length of a string value that was stored in a variable?
Which is better oop or procedural?
Why is it usually a bad idea to use gets()? Suggest a workaround.
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is an identifier?
What is the scope of static variable in c?
hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..
How a string is stored in c?
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
What does sizeof return c?
What is an operator?
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
which is an algorithm for sorting in a growing Lexicographic order
Explain how can you check to see whether a symbol is defined?
What is context in c?