Menu
Question Index
...

How should be the lines M, N, O and P ordered such that x is 11, y is 16 and z is 25 at the end of the program.

class CompoundAssignments
{
    public static void main(String arg[])
    {
        int x = 5;
        int y = 2;
        int z = 3;

        x += 6; // LINE M
        y *= 8; // LINE N
        z += y * x; // LINE O
        z %= 7; // LINE P
    }
}


M, N, O, P
P, O, N, M
N, O, P, M
M, P, O, N

Doubts

Problems

Topic: Arithmetic Compound Assignment Operators In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App