- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMagic.java
More file actions
Latest commit
20 lines (14 loc) · 541 Bytes
/
Copy pathMagic.java
File metadata and controls
20 lines (14 loc) · 541 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
publicclassMagic {
publicstaticvoidmain(String[] args) {
intmyNumber = 10;
// will refer to myNumber as the original number from now on
intstepOne = myNumber*myNumber;
intstepTwo = stepOne + myNumber;
intstepThree = stepTwo / myNumber;
intstepFour = stepThree + 17;
intstepFive = stepFour - myNumber;
intstepSix = stepFive / 6;
System.out.println(stepSix);
// try changing the original number - no matter what the original number is, it always prints out 3 in the terminal!
}
}