-
Notifications
You must be signed in to change notification settings - Fork 0
/
Assignment.java
44 lines (34 loc) · 1.68 KB
/
Assignment.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
public class Assignment {
public static void main(String[] args)
{
int a1, a2, a3, a4;
a1=a2=a3=a4=10;
System.out.println("a1 a2 a3 and a4 will get assigend the same value = " + a1+" " +a2+ " " +a3+ " " +a4);
int a=10;
a +=7;
System.out.println("Value of a was 10 and then the new assigned value of a will get added is = " + a);
int b=10;
b -=7;
System.out.println("Value of b was 10 and then the new assigned value of b will get subtracted is = " + b);
int c=10;
c /=7;
System.out.println("Value of c was 10 and then the new assigned value of c will get divided is = " + c);
int d=10;
d *=7;
System.out.println("Value of d was 10 and then the new assigned value of d will get Multipled is = " + d);
int e=10;
e %=7;
System.out.println("Value of e was 10 and then the new assigned value of e will get added is = " + e);
float f=10f;
f /=7;
System.out.println("Value of f was 10 and then the new assigned value of f will get divided is = " + f);
}
}
//OUTPUT-
//a1 a2 a3 and a4 will get assigend the same value = 10 10 10 10
//Value of a was 10 and then the new assigned value of a will get added is = 17
//Value of b was 10 and then the new assigned value of b will get subtracted is = 3
//Value of c was 10 and then the new assigned value of c will get divided is = 1
//Value of d was 10 and then the new assigned value of d will get Multipled is = 70
//Value of e was 10 and then the new assigned value of e will get added is = 3
//Value of f was 10 and then the new assigned value of f will get divided is = 1.4285715