Skip to content

Commit 4c12af9

Browse files
authored
Create calculator.java
1 parent 1ab8c2e commit 4c12af9

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

calculator.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import java.util.Scanner;
2+
3+
public class calculator {
4+
public static void main(String[] args) {
5+
int num1, num2, sum;
6+
Scanner input = new Scanner(System.in);
7+
System.out.println("Enter first number: ");
8+
num1 = input.nextInt();
9+
System.out.println("Enter second number: ");
10+
num2 = input.nextInt();
11+
sum = num1 + num2;
12+
System.out.println("Sum is: " + sum);
13+
}
14+
}

0 commit comments

Comments
 (0)