+ 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 Answers
+ 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