elithunders
elithunders elithunders
  • 18-01-2020
  • Computers and Technology
contestada

write a c program to print the sum of cubes of odd numbers between 1 to 100​

Respuesta :

tonb
tonb tonb
  • 19-01-2020

Answer:

   int sum = 0;

   for (int i = 1; i < 100; i += 2) {

       sum += i * i;

   }

   printf("The sum of cubes is %d", sum);

   /* Prints: The sum of cubes is 166650 */

Explanation:

If 1 should be excluded, let the for loop start at 3.

Answer Link

Otras preguntas

Which point lies on a circle with a radius of 5 units and center at P(6, 1)?
Explain at least three factors economists consider the measurement of success, or shortcomings, of the economy? And give examples.
Find the value of ax 4 ; a = 2, x = 1. Select one: a. 2 b. 4 c. 1 d. 8
Calculate the mass percent of hydrogen in methyl acetate
Is this correct? Thank you!
Which units can be used to measure length or distance? Check all that apply. gram meter kilometer liter inch
Which of these people has balanced their checkbook correctly? OA. Gary: The balance in his check register is $500 and the balance in his bank statement is $500.
what is a coast of using technology to transport water? A.cities can be built in otherwise uninhabitable areas. B.crops can be irrigated and grown in new areas.
Rockwell hardness of pins of a certain type is known to have a mean value of 50 and a standard deviation of 1.1. (Round your answers to four decimal places.) (a
(12.01g) divided by 6.022 x 10^23