-
Notifications
You must be signed in to change notification settings - Fork 0
/
prac02.java
34 lines (30 loc) · 1.04 KB
/
prac02.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
public class prac02 {
public static void main(String[] args) {
// System.out.println("Welcome to the world of iter");
// String x="Ankit";
// double y=0.5*3*4;
// System.out.println(x);
// System.out.println(y);
int x1 = 45;
int y1 = 68;
int z1 = 98;
// int temp = x1;
// x1 = y1;
// y1 = temp;
// System.out.println("x: " + x1 + " y: " + y1);
// x1 = x1 + y1;
// y1 = x1 - y1;
// x1 = x1 - y1;
// System.out.println("x: " + x1 + " y: " + y1);
x1 = x1 + y1 + z1;
y1 = x1 - y1 - z1;
z1 = x1 - y1 - z1;
x1 = x1 - y1 - z1;
System.out.println("x: " + x1 + " y: " + y1 + " z1 : " + z1);
String ruler1 = "1";
String ruler2 = ruler1 + " 2 " + ruler1;
String ruler3 = ruler2 + " 3 " + ruler2;
String ruler4 = ruler3 + " 4 " + ruler3;
System.out.println(ruler1 + "\n" + ruler2 + "\n" + ruler3 + "\n" + ruler4);
}
}