THINK FIRST·CODE LATER

← All labs

Sum and average of three numbers

Problem

Write a class Numbers that reads three integers from the keyboard and prints:

  • their sum, as Sum: 12
  • their average with two decimal places, as Average: 4.00

Use printf for the average.

Write it here or in your IDE, then paste it. Compile and test it yourself before comparing. Your code stays in your browser — it is never sent to or stored on the server.