Si edad <18 → 'Categoría Juvenil'. Si edad >=18: si edad <=40 → 'Categoría Adulto', si edad >40 → 'Categoría Senior'.
Leer la edad de un deportista y asignar categoría: Juvenil, Adulto o Senior usando condicionales anidados.
Proceso CategoriaDeportiva
Definir edad Como Entero;
Escribir "Ingrese edad:";
Leer edad;
Si edad < 18 Entonces
Escribir "Categoría Juvenil";
SiNo
Si edad <= 40 Entonces
Escribir "Categoría Adulto";
SiNo
Escribir "Categoría Senior";
FinSi
FinSi
FinProceso
edad = int(input("Ingrese edad: "))
if edad < 18:
print("Categoría Juvenil")
else:
if edad <= 40:
print("Categoría Adulto")
else:
print("Categoría Senior")
let edad = parseInt(prompt("Ingrese edad:"));
if (edad < 18) {
alert("Categoría Juvenil");
} else {
if (edad <= 40) alert("Categoría Adulto");
else alert("Categoría Senior");
}
#include
using namespace std;
int main() {
int edad;
cout << "Ingrese edad: ";
cin >> edad;
if (edad < 18) cout << "Categoría Juvenil";
else {
if (edad <= 40) cout << "Categoría Adulto";
else cout << "Categoría Senior";
}
return 0;
}
using System;
class Program {
static void Main() {
Console.Write("Ingrese edad: ");
int edad = int.Parse(Console.ReadLine());
if (edad < 18) Console.WriteLine("Categoría Juvenil");
else {
if (edad <= 40) Console.WriteLine("Categoría Adulto");
else Console.WriteLine("Categoría Senior");
}
}
}
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Ingrese edad: ");
int edad = sc.nextInt();
if (edad < 18) System.out.println("Categoría Juvenil");
else {
if (edad <= 40) System.out.println("Categoría Adulto");
else System.out.println("Categoría Senior");
}
}
}