← Back to User Input
Question 194
Sum and Average of Three Integers
Sum and Average of Three Integers
Read three whole numbers separated by spaces from standard input. Compute their sum and their average, then print a line in the exact form Sum: S, Average: A where S is the integer sum and A is the average shown to two decimal places. The twist: dividing by 3 must use floating-point math (divide by 3.0), or the average will be truncated to a whole number.
Expected Output:
Sum: 12, Average: 4.00= newline. No newline after the last line.
Hints3 available
Sign in to use hintsTopics:
User Input
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.