-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInput_Maths.java
More file actions
22 lines (22 loc) · 799 Bytes
/
Input_Maths.java
File metadata and controls
22 lines (22 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package BasicJavaPrograms;
import java.util.Scanner;
public class Input_Maths {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter number A : ");
int a = sc.nextInt();
System.out.println("Enter number B : ");
int b = sc.nextInt();
int sum = a + b;
System.out.println("The sum is: " + sum);
int difference = a - b;
System.out.println("The difference is: " + difference);
int product = a * b;
System.out.println("The product is: " + product);
int quotient = a / b;
System.out.println("The quotient is: " + quotient);
int remainder = a % b;
System.out.println("The remainder is: " + remainder);
sc.close();
}
}