rokhmanisa rokhmanisa
  • 20-05-2021
  • Computers and Technology
contestada

write a c program to find product of all even numbers between 10 t0 30

Respuesta :

tonb
tonb tonb
  • 20-05-2021

Answer:

#include <stdio.h>

int main(void) {

 unsigned long n = 1;

 for(unsigned long i=10; i<=30; i+=2) {

   n *= i;

 }

 printf("%lu",n);

 return 0;

}

Explanation:

The output is: 111588212736000

The answer will take 47 bits, so you have to use 64-bit longs. An int is 32 bit thus will give the wrong answer due to a numeric overflow.

Answer Link

Otras preguntas

Verify the identity Cos^2x-Sin^2x=1-2sin^2x
What industry has declined in Iran because of pollution?
How are symbiotic relationships similar to and different from predator-prey interactions?
Why is it important that the space in the chest get bigger
Can someone help me with this question I don't know how to subtract a whole number by a fraction
What is the simplest form of 27/42?    a.27/42  d.9/14   b.1 15/27  e.13/21   c.2/3
How tall would I  be if i were 54 inches   How tall would I be if i were 58 inches?   How tall would i be if Iwere 59 inches?
factor each polynomial  5xy-10x
Mothers who were unresponsive, insensitive, and coldly rejecting were associated with ___________ attached infants.A. securelyB. avoidantC. ambivalentD. disorga
Which of the following is NOT indicated by Mendel’s experiments? (A) incomplete dominance (B) segregation (C) recessive (D) dominant (E) independent assortment