Ask Question
1 April, 14:06

Write a for loop that assigns summedvalue with the sum of all odd values from 1 to usernum. assume usernum is always greater than or equal to 1. ex: if usernum is 5, then summedvalue is 9 (i. e. 1 + 3 + 5 = 9).

+1
Answers (1)
  1. 1 April, 17:25
    0
    I don't know which language you use those, so I assume that you use c++

    for (int i = 1; i < = userNum; i++)

    {

    summedValue = summedValue + i;

    i = i + 1;

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a for loop that assigns summedvalue with the sum of all odd values from 1 to usernum. assume usernum is always greater than or equal ...” in 📘 Mathematics 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