Created
October 3, 2022 21:02
-
-
Save rmg007/24bac1ae91e29e8a1ffa0fa7e1a406cf to your computer and use it in GitHub Desktop.
learn and dive deep into Java Course. Arithmetic Operators Part 1 lecture
This file contains hidden or 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 = 8; | |
double y = 5; | |
//double addition = x + y; | |
int addition = (int) (x + y); | |
System.out.println("addition result: " + addition); | |
//int subtraction = (int) (x - y); | |
double subtraction = x - y; | |
System.out.println("subtraction result: " + subtraction); | |
//double multiplication = x * y; | |
int multiplication = (int) (x*y); | |
System.out.println("multiplication result: " + multiplication); | |
int num1 = 8; | |
double num2 = 5; | |
double division = num1 / num2; | |
System.out.println(division); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment