Skip to content

Instantly share code, notes, and snippets.

@PocasPedro
Created October 2, 2017 13:55
Show Gist options
  • Save PocasPedro/399c2361b3ec29bcdb99fa6bd229a8e4 to your computer and use it in GitHub Desktop.
Save PocasPedro/399c2361b3ec29bcdb99fa6bd229a8e4 to your computer and use it in GitHub Desktop.
Java Fundaments for Kids - Exercise 2
/**
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