Menu
Question Index
...

What will be the output of the following program?

class Operators1
{
    public static void main(String[] args)
    {
        int a = 34;
        int b = 21;
        int c = a++ + ++b;
        int d = --a + --b + c--;
        int e = a + +b + +c + d--;
        int f = -a + b-- + -c - d++;
        int sum = a + b + c + d + e + f;
        System.out.println("sum = " + sum);
    }
}


sum = 265
sum = 263
sum = 264
Compilation Error

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