-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNewClass7.java
More file actions
34 lines (26 loc) · 947 Bytes
/
NewClass7.java
File metadata and controls
34 lines (26 loc) · 947 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
33
34
//Arithmatic Operator and type castting-------
package javaapplication;
import java.util.Scanner;
/**
* @author ARIFUL ISLAM
*/
public class NewClass7 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int num1 = 10 ,num2 = 20 , result;
System.out.print("Enter Frist number : ");
num1 = input.nextInt();
System.out.print("Enter Secound number : ");
num2 = input.nextInt();
result = num1 + num2;
System.out.println("Sum : "+result);
result = num1 - num2;
System.out.println("Sum : "+result);
result = num1 * num2;
System.out.println("Sum : "+result);
double result2 = (double)num1 / num2;
System.out.println("Sum : "+result2);
result = num1 % num2;
System.out.println("Sum : "+result);
}
}