Ask Question
12 February, 03:58

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).

+5
Answers (1)
  1. 12 February, 04:13
    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?
Get 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 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