What will be the output of the following code? int m = 2; int n = 15; for (int i = 1; i < 5; i++) m++; --n; System.out.println("m = " + m); System.out.println("n = " + n);
Advertisements
Question
What will be the output of the following code?
int m = 2;
int n = 15;
for (int i = 1; i < 5; i++)
m++;
--n;
System.out.println("m = " + m);
System.out.println("n = " + n);Answer in Brief
Advertisements
Solution
m = 6
n = 14
shaalaa.com
Is there an error in this question or solution?
