Created
July 29, 2025 13:23
-
-
Save mukhtharcm/b1998b33430a0a332ff51940685ae22c to your computer and use it in GitHub Desktop.
Dart Basics: Math and comparisons
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
void main() { | |
int a = 10; | |
int b = 5; | |
// Math | |
print("a + b = ${a + b}"); // Addition | |
print("a - b = ${a - b}"); // Subtraction | |
print("a * b = ${a * b}"); // Multiplication | |
print("a / b = ${a / b}"); // Division | |
print("---"); | |
// Comparisons (they result in a true or false value) | |
print("Is a equal to 10? ${a == 10}"); // true | |
print("Is b not equal to 5? ${b != 5}"); // false | |
print("Is a greater than b? ${a > b}"); // true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment