Created
October 2, 2017 13:55
-
-
Save PocasPedro/399c2361b3ec29bcdb99fa6bd229a8e4 to your computer and use it in GitHub Desktop.
Java Fundaments for Kids - Exercise 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Program that makes several mathematical operations | |
*/ | |
public class Calculator2 { | |
public static void main(String[] args) { | |
int op1 = 30; | |
int op2 = 3; | |
int result = op1 - op2; | |
// Prints the variable result of the first operation to the terminal window. | |
System.out.println("The result of " + op1 + " - " + op2 + "is " + result); | |
result = op1 * op2; | |
// Prints the variable result of the second operation to the terminal window. | |
System.out.println("The result of " + op1 + " multiplied by " + op2 + "is " + result); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment