JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public class Program
{
public static void main(String[] args) {
int result = 0;
for (int i = 0; i < 5; i++) {
System.out.print("Loop("+i+"): ");
if (i == 3) {
System.out.print(result + " + 10 = ");
result += 10;
System.out.println(result);
} else {
System.out.print(result + " + " + i + " = ");
result += i;
System.out.println(result);
}
}
System.out.println("Final Result: " + result);
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run