forked from TusharKukra/Hacktoberfest2020
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMath.java
More file actions
23 lines (19 loc) · 641 Bytes
/
Math.java
File metadata and controls
23 lines (19 loc) · 641 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.util.Scanner;
public class Math {
public static void main(String[] args) {
int ans,n1,n2;
Scanner scan1 = new Scanner(System.in);
System.out.println("Enter two numbers ");
n1 = scan1.nextInt();
n2 = scan1.nextInt();
ans1 = n1 + n2;
System.out.println("Addition = "+ans1);
ans2 = n1 - n2;
System.out.println("Subtraction = "+ans2);
ans3 = n1 * n2;
System.out.println("Multiplication = "+ans3);
ans4 = n1/n2;
System.out.println("Quotient = "+ans4+" & Remainder = "+n1%n2);
scan.close();
}
}