Write a program to print prime nums from 1-20 using c
programing?
Answer Posted / ankur mohan sharma
#include<stdio.h>
#include<conio.h>
int main()
{
int i,n;
for(n=2;n<=20;n++)
{
for(i=2;i<n;i++)
{if(n%i==0)
break;}
}
if(i==n)
printf("\n %d",n);
return 0;
}
| Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
Write a program of advanced Fibonacci series.
What is stack in c?
Can we compile a program without main() function?
How do you sort filenames in a directory?
Can a pointer be static?
What is bubble sort technique in c?
Difference between macros and inline functions? Can a function be forced as inline?
How are portions of a program disabled in demo versions?
What is pragma c?
Why we write conio h in c?
Tell me when would you use a pointer to a function?
Explain how can a program be made to print the name of a source file where an error occurs?
What are formal parameters?
Why is c so powerful?
What is bash c?