+ 3

What is the output of this code? Why?

int[] num = new int[5]; booleanl] boo = new boolean[5]; for (int i = 0; i < 5; i++){ if (boo[i]) System.out.print(num[i] % 10); else System.out.print((num[i] + 5) % 10); }

23rd Jul 2018, 2:09 PM
PRINCE MATHEW
PRINCE MATHEW - avatar
3 Answers
+ 1
I have noted that you post always same question (with different code) then i ask you cant run these codes?
23rd Jul 2018, 2:36 PM
KrOW
KrOW - avatar
+ 1
default value for boolean is false . and default value for int is 0. therefore output is 55555
24th Jul 2018, 3:38 PM
Steven Cai
Steven Cai - avatar