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
Why is it that not all header files are declared in every C program?
What is sizeof int in c?
What does == mean in texting?
Tell me about low level programming languages.
What is the explanation for modular programming?
What are pointers in C? Give an example where to illustrate their significance.
What is a char in c?
How can I change their mode to binary?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
What is typedef example?
What standard functions are available to manipulate strings?
Why is this loop always executing once?
"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks
Explain what is a static function?
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