Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: if, else-if, else | Керуючі Структури
Основи C#

bookChallenge: if, else-if, else

Завдання

Swipe to start coding

Write a program that reads an integer age from the user and prints the user's category based on the following rules:

  • If the age is less than 18, print "child";
  • If the age is 18 or older but less than 65, print "adult";
  • If the age is 65 or older, print "senior".

Use if, else if, and else statements to implement this logic. Only print the category name ("child", "adult", or "senior").

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 14
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

close

bookChallenge: if, else-if, else

Свайпніть щоб показати меню

Завдання

Swipe to start coding

Write a program that reads an integer age from the user and prints the user's category based on the following rules:

  • If the age is less than 18, print "child";
  • If the age is 18 or older but less than 65, print "adult";
  • If the age is 65 or older, print "senior".

Use if, else if, and else statements to implement this logic. Only print the category name ("child", "adult", or "senior").

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 14
single

single

some-alt