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 the benefit of using #define to declare a constant?
Why does everyone say not to use scanf? What should I use instead?
How can I make sure that my program is the only one accessing a file?
What is an lvalue?
Is sizeof a keyword in c?
Why c is called top down?
Explain what’s a signal? Explain what do I use signals for?
Describe explain how arrays can be passed to a user defined function
What is the code in while loop that returns the output of given code?
Explain what standard functions are available to manipulate strings?
Is using exit() the same as using return?
What is 1f in c?
What's the total generic pointer type?
How was c created?
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....