Created
July 29, 2025 13:19
-
-
Save mukhtharcm/bf6c0747f584a790059ff8bf2a8b1a3c to your computer and use it in GitHub Desktop.
Dart Variables and Printing
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() { | |
// Variables are like labeled boxes to store information. | |
// String: For text | |
String name = "Ahmed"; | |
// int: For whole numbers | |
int age = 28; | |
// double: For numbers with decimals | |
double bankBalance = 1250.75; | |
// bool: For true/false values | |
bool isZakatDue = true; | |
// The print() function displays the value in the console. | |
print("My name is " + name); // You can join strings with + | |
print("My age is: $age"); // Or embed variables directly with $ | |
print("My balance is: $bankBalance"); | |
print("Is Zakat due? $isZakatDue"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment