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

write the following sentence using mathematical symbols twice x, plus 5, is the same as -13
I can evaluate expressions if J=3 K=6 M=12 8(M-K) + 5
In economics what is the major role of buisness? A:Guide the economy B:Purchase services C:Organize production D:Establish safety regulations
Traditional grammar is based on the Latin language. true or false
Heredity environment and behavior are all aspects that can limit a persons related factors
Which of the following is an interjection? A. Hunting B. Wow C. Is D. Acrimonious
If the climate in Africa remains the same as described, what would you MOST LIKELY expect to see after many years?
Every prospective naturalized United States citizen must take an oath of allegiance to the US government before becoming a citizen. Please select the best a
Please help!!! Organic architecture focused on letting each building grow naturally from its environment. What was the basic principle of Frank Lloyd Wright’s o
PLEASE HELP !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!