โ Back to Loops
Question 319
Sum of Odd Numbers 1 to 9
Sum of Odd Numbers 1 to 9
Use a loop to add the odd numbers 1, 3, 5, 7, 9 and print the total. The exact output is:
25
Step the loop counter by 2.Expected Output:
25
Topics:
Loops
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.