-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsum.java
More file actions
17 lines (15 loc) · 562 Bytes
/
Copy pathsum.java
File metadata and controls
17 lines (15 loc) · 562 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package Basics;
import java.util.Scanner;
public class sum {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print("Enter the first number: ");
int num1 = input.nextInt();
System.out.print("Enter the second number : ");
int num2 = input.nextInt();
int sum = num1 + num2;
System.out.println("The sum of the above two numbers is : " + sum);
int diff = num1 - num2;
System.out.println("The difference of the two numbers is : " + diff);
}
}