Created
October 3, 2022 21:07
-
-
Save rmg007/3a990cb8f6f405eac65d049968c14052 to your computer and use it in GitHub Desktop.
learn and dive deep into Java. Arithmetic Operators Part 2 lecture
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
public class Main { | |
/* | |
+, -, *, /, %, ++, - - | |
*/ | |
public static void main(String[] args) { | |
int x = 5; | |
int y = 2; | |
// modulo operator - % division remainder | |
int remainder = x % y; | |
System.out.println("remainder: " + remainder); | |
System.out.println(7 % 3); | |
int n = 5; | |
// ++ increment operator | |
n++; | |
System.out.println(n); | |
n = 10; | |
n--; | |
System.out.println(n); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment