I do not understand why the division "/" does not work.
Anonymous #10752052
Nivel 5
Please help!
Resuelta
Comentarios (3)
- Populares
- Nuevas
- Antiguas
Debes iniciar sesión para dejar un comentario
Anonymous #10752052
3 julio 2021, 12:22
Ok. I understand! thanks
0
Jose Antonio
30 junio 2021, 13:45útil
with
/
you calculate the result of the division but you are interested in knowing if it is a multiple of the number
I recommend you see the operators
+1
Thomas
30 junio 2021, 13:02útil
if you take eg as input data 1600 then this is clearly a leap year
now think about what will be the result of your first condition
if (year / 400 == 0)
that's 1600 / 400 == 0 or 4 == 0 -> and that's of course false ==> no leap year
you probably wanted to try the modulo operator...
+1