Write a program to print prime nums from 1-20 using c
programing?
Answer Posted / r@m$
#include<stdio.h>
void main(){
int x;
for(x=2;x<=20;x++){
if(x<4)
printf("%d\t",x);
else
if(x%2!=0 && x%3!=0)
printf("%d\t",x);
}
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Why is it important to memset a variable, immediately after allocating memory to it ?
Why static variable is used in c?
Explain what is the benefit of using #define to declare a constant?
What is scope of variable in c?
How can I swap two values without using a temporary?
What does volatile do?
Which header file is used for clrscr?
What is a pragma?
How can I trap or ignore keyboard interrupts like control-c?
When should volatile modifier be used?
Who is the founder of c language?
What is the c value paradox and how is it explained?
How can you increase the allowable number of simultaneously open files?
How can I find the modification date and time of a file?
How many types of errors are there in c language? Explain