Sum of Two Numbers
Here, You will learn to create the sum of two numbers in java programming.
Addition: The addition is the process of adding two numbers together to get the addition of two numbers.
For example:
a = 50
b = 45
Sum = a + b;
Sum of two number is 95
Sum of Two Numbers in Java Program
1 2 3 4 5 6 7 8 9 10 11 | import java.io.*; import java.lang.*; class sumOftwoNum{ public static void main(String args[]){ int a,b,sum; a = 10; b = 15; sum = a + b; System.out.println("The sum of two numbers is " + sum); } } |
Output
Check out our other Java Programming Examples