Computer Science, asked by debadyuti12, 11 months ago

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);​

Answers

Answered by charlie1505
18

Answer:

Output will be

m=6

n=14

Explanation:

In for loop m will iterate 4 time as there postfix operator so it will first print value of m ie, 6 and then it will Increamented by 1.

And for n, as there prefix operator used it will immediately decrement n by 1

Answered by maheshdolly87363
0

output will be

m=6

n=14

Similar questions