Skip to content

Instantly share code, notes, and snippets.

@HaradaKumiko
Created January 10, 2022 16:54
Show Gist options
  • Save HaradaKumiko/6e5c825d25ac06cab3aed5097bbc1ede to your computer and use it in GitHub Desktop.
Save HaradaKumiko/6e5c825d25ac06cab3aed5097bbc1ede to your computer and use it in GitHub Desktop.
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