Explanatory Question
What will be the output of the following code?
int m = 2;
int n = 15;
for(int i = 1; i < 5; i++) {
m += i; // m = m + i
n -= i; // n = n - i
}
System.out.println("m = " + m); // Output for m
System.out.println("n = " + n); // Output for n
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.