Question: *** PROGRAM IN MIPS ASSEMBLY LANGUAGE*** Compute the sum of all odd integers from 1 inclusive up to (and possibly including) top. The value for
*** PROGRAM IN MIPS ASSEMBLY LANGUAGE***
Compute the sum of all odd integers from 1 inclusive up to (and possibly including) top. The value for top may or may not be included in the final sum depending on whether top is an odd or even integer. (1+3+5+7+...)
- Prompt the user to supply a value for top.
- Determine if value is even or odd. If even, subtract one to make it odd. If value is odd, leave as is
- Use a looping construct to generate the sum.
- Display the result sum to the Run I/O window.
EXAMPLE:
Enter top value: 12
Sum: 36
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
