Ask Question
23 July, 20:27

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

+3
Answers (1)
  1. 23 July, 23:45
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers