0
please assist with how this code computes to get the 17
int result = 0; for (int i = 0; i < 5; i++) { if (i == 3) { result += 10; } else { result += i; } } System.out.println(result);
3 Réponses
+ 3
When the condition is false values of i includes 0,1,2,4 therefore result is 7 but when it's true the value of result is now 10 + 7 which is 17
0
It is computed step by step (sequential), evaluating each expression and execute the statement for each line of code.