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
Is it possible to pass an entire structure to functions?
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"
plz let me know how to become a telecom protocol tester. thank you.
How can I manipulate strings of multibyte characters?
Explain what does a function declared as pascal do differently?
What is volatile variable in c with example?
Why c is called object oriented language?
Explain the advantages of using macro in c language?
What is substring in c?
difference between native and cross compilers
What is a pointer on a pointer in c programming language?
What is queue in c?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
Apart from dennis ritchie who the other person who contributed in design of c language.
Explain about C function prototype?