Skip to content

Instantly share code, notes, and snippets.

@mukhtharcm
Created July 29, 2025 13:23
Show Gist options
  • Save mukhtharcm/b1998b33430a0a332ff51940685ae22c to your computer and use it in GitHub Desktop.
Save mukhtharcm/b1998b33430a0a332ff51940685ae22c to your computer and use it in GitHub Desktop.
Dart Basics: Math and comparisons
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