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

Which equation in point-slope form contains the points (6, 2) and (2, 4)?
Catherine is pregnant and preparing for childbirth. She knows a woman who assists in childbirth. The woman has not been to any medical school, but she is adept
At the periphery of a hurricane, the air is ____.
which best states how the US constitution affects the separation of powers in the federal government
How did the Civil Rights Movement change in the late 1960’s??
which metal is more active than ni and less active than zn
What can be displayed on a climatic graph?
what characteristics of the Confederate States of America made it a confederal government when compared to the government of the United States?
A direct variation function contains the points (–8, –6) and (12, 9). Which equation represents the function? y = –4/3x y = –3/4x y = 3/4x y =4/3 x
A bar graph can be horizontally or vertically oriented. True or False?