Write a program to print prime nums from 1-20 using c
programing?
Answer Posted / rupamrox
#include<stdio.h>
#include<conio.h>
main()
{
int i,j,prime;
clrscr();
for(i=2;i<20;i++)
{
prime=1;
for(j=2;j<i;j++)
{
if(i%j==0)
prime=0;
}
if(prime==1)
printf("%d",i);
}
getch();
}
Is This Answer Correct ? | 9 Yes | 7 No |
Post New Answer View All Answers
What is the ANSI C Standard?
Is a house a mass structure?
What is c definition?
what is bit rate & baud rate? plz give wave forms
What is strcmp in c?
What is scope rule in c?
Why isn't any of this standardized in c? Any real program has to do some of these things.
Where local variables are stored in c?
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
Write a program to print all permutations of a given string.
How can I discover how many arguments a function was actually called with?
What is difference between array and structure in c?
What is null pointer constant?
What are reserved words?
What are high level languages like C and FORTRAN also known as?