Ask Question
21 April, 01:15

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

+4
Answers (1)
  1. 21 April, 01:18
    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 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