forked from mohammedabdulbari/Java-SE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Arithmetic.java
53 lines (34 loc) · 971 Bytes
/
Arithmetic.java
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package arithematic;
public class Arithematic {
public static void main(String[] args) {
/* for integer values
int a=14,b=5;
int c=a/b;
int r=a%b;
System.out.println(c);
System.out.println(r);*/
/*for float values
float a=14.3f,b=3.2f;
float c=a/b;
float r=a%b;
System.out.println(c);
System.out.println(r);*/
/* for different data types
byte a=10;
short b=15;
int c=a+b;
float a=12.5f;
long b=1231;
float c=a*b;
float a=12.5f;
double b=123;
double c=a*b;
char a=40;
int b=30;
int c=a-b;
System.out.println(c);
*/
System.out.println((10+20)/2);
System.out.println(10/(2*5));
}
}