Addition of Two Numbers:

public class AddNumbers {

 public static void main(String[] args) {

 int num1 = 5, num2 = 10, sum;

 sum = num1 + num2;

 System.out.println(“Sum of ” + num1 + ” and ” + num2 + ” is: ” + sum);

 }

Output:

Sum of 5 and 10 is: 15

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *