precios <- matrix(c(
120, 250, 180, 300, 150,
220, 175, 400, 280, 195,
130, 260, 310, 145, 500,
210, 190, 275, 330, 160,
240, 350, 125, 290, 450,
3, 235, 247, 347, 987
), nrow = 6, ncol = 5, byrow = TRUE)
# Mostrar la matriz
print("Matriz de precios:")
print(precios)
# Encontrar el precio mayor
precio_mayor <- max(precios)
# Encontrar el precio menor
precio_menor <- min(precios)
# Mostrar resultados
print(paste("El precio mayor es:", precio_mayor))
print(paste("El precio menor es:", precio_menor))
To embed this project on your website, copy the following code and paste it into your website's HTML: