How to enter a value in kotlin and have it added 10 times and then divided into 10 using a flow (while) control.
This is my code:
calcular.setOnClickListener {
if (et_valor.text.isEmpty())
Toast.makeText(this, "Debe ingresar un valor", Toast.LENGTH_SHORT).show()
val valor = et_valor.text.toString().toInt()
var x = 0
val suma = 0
while (x < 10) {
val suma2 = suma+valor
val division = suma2/10
x++
tv_resultad.text=("La sema del numero es $suma2 y la division es $division");tv_resultad.text.toString().plus(x)
}