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 to print all permutations of a given string.
Explain what is a stream?
Explain what is a const pointer?
What are void pointers in c?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
Explain enumerated types.
Find MAXIMUM of three distinct integers using a single C statement
what is recursion in C
What is the difference between āgā and āgā in C?
write a program to display all prime numbers
diff between exptected result and requirement?
What is the difference between Printf(..) and sprint(...) ?
Is array name a pointer?
Write a code to remove duplicates in a string.
Mention four important string handling functions in c languages .