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
What is union in c?
Implement bit Array in C.
How will you declare an array of three function pointers where each function receives two ints and returns a float?
Explain what will the preprocessor do for a program?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Write a program to print fibonacci series without using recursion?
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
What is the use of static variable in c?
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
application attempts to perform an operation?
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
How will you delete a node in DLL?
Place the #include statement must be written in the program?
Write a program to generate random numbers in c?
Explain how can I convert a number to a string?