Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created February 4, 2022 03:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/79a5846b5af87f048649a22ccb6ef7df to your computer and use it in GitHub Desktop.
Save parzibyte/79a5846b5af87f048649a22ccb6ef7df to your computer and use it in GitHub Desktop.
Algoritmo sin_titulo
Dimension numeros[200];
Escribir "Ingrese la cantidad de datos: ";
Leer cantidad_elementos;
// Leer datos
Para i<-1 Hasta cantidad_elementos Hacer
Escribir "Ingrese el dato ",i,":"
Leer numeros[i]
FinPara
// Inicializar mayor y menor
mayor <- numeros[1]
menor <- numeros[1]
// Obtener mayor y menor
Para i<-1 Hasta cantidad_elementos Hacer
numero <- numeros[i]
Si numero > mayor Entonces
mayor = numero
FinSi
Si numero < menor Entonces
menor = numero
FinSi
FinPara
Escribir "Número mayor: ", mayor;
Escribir "Número menor: ", menor;
FinAlgoritmo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment