Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: if, else-if, else | Estruturas de Controle
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Fundamentos de C#

bookChallenge: if, else-if, else

Tarefa

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").

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 14
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

close

bookChallenge: if, else-if, else

Deslize para mostrar o menu

Tarefa

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").

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 14
single

single

some-alt