Menu
Question Index
...

What will be the output of the following program?

class MyClass
{
    public static void main(String s[])
    {
        int i = 4;
        int j = 21;

        int k = ++i * 7 + 2 - j--;

        System.out.println("k = " + k);
    }
}


k = 16
Program does not compile
k = 11
k = 17

Doubts

Problems

Topic: Increment And Decrement 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