Ask Question

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

+1
Answers (1)
  1. 26 January, 14:27
    0
    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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a c program to print the sum of cubes of odd numbers between 1 to 100 ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers