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
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
Is file a keyword in c?
Is main is user defined function?
What is the purpose of & in scanf?
What is the difference between printf and scanf )?
How can I sort more data than will fit in memory?
Explain how are 16- and 32-bit numbers stored?
What are the disadvantages of c language?
Is return a keyword in c?
What does 1f stand for?
What is restrict keyword in c?
"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
How can I send mail from within a c program?
Are pointers integers in c?
Is void a keyword in c?