Menu BAR

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

8 Feb 2024

JAVA - SUBTRACT TWO NUMBERS


 Write a JAVA program to subtract two numbers?




public class SubtractTwoNumbers { 

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

                                System.out.println("Difference of " + num1 + " and " + num2 + " is: " + difference);
                 

}

No comments:

Post a Comment