- Home
- Arithmetic operators
- Equivalent operations

Monday, November 13, 2023
⁃
Difficulty:
Easy

Write a Java program to ask the user for three numbers *(a, b, c)* and display the result of *(a+b)*c* and the result of *a * c + b*c*.

- Request three numbers from the user (a, b, c).
- Calculate the result of (a+b)*c.
- Calculate the result of a * c + b*c.
- Display both results on separate lines.

2 4 2

Result 1: 12 Result 2: 12

Share it on your social media and challenge your friends to solve programming problems. Together, we can learn and grow.

The code has been successfully copied to the clipboard.

Continue improving your Java programming skills with our selection of practical exercises from the lesson. Click on Practice and challenge your knowledge!

Practice with easy and intermediate Java exercises on arithmetic operations and some types of numerical data.