why if a boolean value is declared true in this exercise, then we call it false Shouldn’t it keep its value true because Is this how we declare it in the variable?
fun main(parametro: Array) {
val arreglo = IntArray(10)
for(i in 0…arreglo.size-1) {
print(“Ingrese elemento:”)
arreglo[i] = readLine()!!.toInt()
}
var ordenado = true
for(i in 0…arreglo.size-2)
if (arreglo[i+1] < arreglo[i])
ordenado = false
if (ordenado)
print(“Los elementos están ordenados de menor a mayor”)
else
print(“Los elementos no están ordenados de menor a mayor”)
}