-1
When doing the division operation int
/ int
, the language rounds down to keep the value as type int
.
Contador
is 49, maximum
is > 49.
A division of an int by a value greater than it will always be less than 0
, so the result will be rounded to 0
.
Consider changing the type of variables or use a cast
for double
and retell the test. :)
Where
atual
is declared? In this your code, the execution forwhile
, thereforeatual
is not performed. Post the code snippet where it is declared and where it is changed.– CypherPotato