Java application to calculate the sum, average, product, smallest and largest of three numbers. The program below is the solution to Deitel’s Java How to Program (9th Edition) Chapter 2 Exercise 2.17.

 
Question: Write an application that inputs three integers from the user and displays the sum, average, product, smallest and largest of the numbers. Use the techniques shown in Fig. 2.15. [Note: The calculation of the average in this exercise should result in an integer representation of the average. So, if the sum of the values is 7, the average should be 2, not 2.3333….]

Arithmetic Smallest largest in Java
Sample Program Run

Click here to see other solutions to Java How to Program.

2 Comments

Write A Comment