Created
January 10, 2022 16:54
-
-
Save HaradaKumiko/6e5c825d25ac06cab3aed5097bbc1ede to your computer and use it in GitHub Desktop.
This file contains 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? nullValue; | |
int zeroValue, nonZeroValue; | |
zeroValue = 0; | |
nonZeroValue = 5; | |
// nullValue = 6; | |
print(hitung(nullValue, nonZeroValue)); | |
} | |
int hitung(int? nullValue, int nonZeroValue) { | |
if (nullValue == null) { | |
return nonZeroValue; | |
} else { | |
return nonZeroValue + nullValue; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment