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
What is else if ladder?
What are different types of pointers?
Explain what are the different file extensions involved when programming in c?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
What is the purpose of main( ) in c language?
What is assignment operator?
Can a function argument have default value?
Are bit fields portable?
What is the default value of local and global variables in c?
What is the meaning of typedef struct in c?
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
Why main is not a keyword in c?
How can you determine the size of an allocated portion of memory?
What is the use of getch ()?
Write a program which returns the first non repetitive character in the string?