Menu BAR

FEEL FREE TO ASK ANY PROGRAM and please mention any error if you find it

7 Feb 2024

JAVA - ADD TWO NUMBERS


 ## Write a Java program to add two numbers




public class AddTwoNumbers { 

    public static void main(String[] args) {
                
                int num1 = 5; int num2 = 10; 
                int sum = num1 + num2; 

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

No comments:

Post a Comment