what's the ((x%10)/5) mean | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 2

what's the ((x%10)/5) mean

if the roop has 20 numbers,it will println like this 00000111110000011111, for(i=0;i<20;i++){ system.out.print((x%10)/5); } Why is that? If I want to get three 0 followed by five 1, and then loop, how should i do,like this 000111110001111100011111

17th Jan 2017, 1:14 PM
xuyexu
xuyexu - avatar
2 Respuestas
+ 7
x%10 returns the remainder of x divided by 10. Then, after computing x%10, we divide the value by 5.
17th Jan 2017, 1:16 PM
Hatsy Rei
Hatsy Rei - avatar
0
????
17th Jan 2017, 2:52 PM
Dominic Torato
Dominic Torato - avatar