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

bookChallenge: if, else-if, else

Tarea

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

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 14
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

close

bookChallenge: if, else-if, else

Desliza para mostrar el menú

Tarea

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

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 14
single

single

some-alt