Ask Question
23 November, 23:43

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

+2
Answers (1)
  1. 24 November, 00:09
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers