-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasicCalculation.java
More file actions
32 lines (29 loc) · 920 Bytes
/
Copy pathBasicCalculation.java
File metadata and controls
32 lines (29 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import java.util.*;
public class BasicCalculation
{
public static void main(String args[])
{
int a,b,c;
Scanner sc= new Scanner(System.in);
System.out.println("Enter a & b for addition");
a=sc.nextInt();
b=sc.nextInt();
c=a+b;
System.out.println("Sum of two numbers = "+c);
System.out.println("Enter a & b for substaction");
a=sc.nextInt();
b=sc.nextInt();
c=a-b;
System.out.println("Difference of two numbers = "+c);
System.out.println("Enter a & b for Multiplication");
a=sc.nextInt();
b=sc.nextInt();
c=a*b;
System.out.println("Product of two numbers = "+c);
System.out.println("Enter a & b for Division");
a=sc.nextInt();
b=sc.nextInt();
c=a/b;
System.out.println("Quotient of two numbers = "+c);
}
}