Created
March 21, 2019 04:55
-
-
Save AAQ-AND-DEV/0d8b50dd45b6c9ab25abb047f90d3bff to your computer and use it in GitHub Desktop.
first dart nested function
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(){ | |
var num = 47; | |
//is and is! | |
print(num is String); | |
print(num is! bool); | |
print(num is int); | |
//If statement | |
if(num is! int){ | |
print("$num is not an int"); | |
} | |
else { | |
print("$num is an int!"); | |
} | |
void evaluate(int num){ | |
if(num >=50){ | |
print("$num is greater than or equal to 50"); | |
} | |
else if(num>=25){ | |
print("$num is greater than or equal to 25 and less than 50"); | |
} | |
else { | |
print("$num is less than 25"); | |
} | |
} | |
evaluate(num); | |
num = 1100; | |
evaluate(num); | |
num = -34; | |
evaluate(num); | |
num = 34; | |
evaluate(num); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment