Created
November 18, 2020 15:15
-
-
Save internetova/c67aa50d69208044a80ef17b26782faf to your computer and use it in GitHub Desktop.
lesson_2.3-1
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
// Задание 1 | |
// Создайте целочисленную переменную с именем a проверить является ли число четным. | |
void main() { | |
const a = 7; | |
if (a.isEven) { | |
print('Число $a чётное'); | |
} else { | |
print('Число $a нечётное'); | |
} | |
// Или через остаток от деления | |
if (a % 2 == 0) { | |
print('Число $a чётное'); | |
} else { | |
print('Число $a нечётное'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment