Skip to content

Instantly share code, notes, and snippets.

@internetova
Created November 18, 2020 15:15
Show Gist options
  • Save internetova/c67aa50d69208044a80ef17b26782faf to your computer and use it in GitHub Desktop.
Save internetova/c67aa50d69208044a80ef17b26782faf to your computer and use it in GitHub Desktop.
lesson_2.3-1
// Задание 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