0

What is the output of this code?

int result = 0; for (int i = 0; i < 5; i++) { if (i == 3) { result += 10; } else { result += i; } } System.out.println(result);

19th Feb 2018, 7:49 AM
prajakta pawar
prajakta pawar - avatar
5 Answers
+ 2
17
19th Feb 2018, 10:39 AM
Dominique Abou Samah
Dominique Abou Samah - avatar
+ 1
is this a challenge or you have a problem with the code?
19th Feb 2018, 8:08 AM
Farshaad Heydari
Farshaad Heydari - avatar
+ 1
Run this at code playground & verify the result.
19th Feb 2018, 7:26 PM
Vijay
Vijay - avatar
0
37
19th Feb 2018, 8:31 AM
‎ ‏‏‎Anonymous Guy
0
sorry my mistake
19th Feb 2018, 11:47 AM
‎ ‏‏‎Anonymous Guy