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
Write a program to use switch statement.
What do you mean by Recursion Function?
What is calloc in c?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
What is a const pointer?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
What is the general form of a C program?
What does 4d mean in c?
What is a structure member in c?
What is union and structure in c?
What is the purpose of main() function?
which is an algorithm for sorting in a growing Lexicographic order
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
What is array of pointers to string?
Write a program of prime number using recursion.