Java: Calculate the sum of two integers and return true if the sum is equal to a third integer
Sum Equals Third Integer
Write a Java program to calculate the sum of two integers and return true if the sum is equal to a third integer.
Sample Solution:
Java Code:
Sample Output:
Input the first number : 5 Input the second number: 10 Input the third number : 15 The result is: true
Pictorial Presentation:
Flowchart:
For more Practice: Solve these Related Problems:
- Modify the program to check if the product equals the third integer.
- Allow the user to enter multiple numbers and check the sum.
- Write a program to check if the difference between two numbers equals a third number.
- Modify the program to work with floating-point numbers.
Go to:
PREV : String to Integer Conversion.
NEXT :
Number Comparison Logic.
Java Code Editor:
What is the difficulty level of this exercise?
Based on 68 votes, average difficulty level of this exercise is Hard
.
Test your Programming skills with w3resource's quiz.