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
How can I manipulate individual bits?
What is the use of parallelize in spark?
Can stdout be forced to print somewhere other than the screen?
What is #ifdef ? What is its application?
What is variable initialization and why is it important?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples
What is structure in c definition?
Write the Program to reverse a string using pointers.
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
How can I remove the leading spaces from a string?
Explain Function Pointer?
What functions are in conio h?
What are the different types of constants?
Can include files be nested?