IncrementDecrement Quiz

39
Created on By Baibhav Computer

IncrementDecrement Quiz

1 / 10

What will be the output of the below program?

public class IncrementDecrement4

{

public static void main(String[] args)

{

int i=1, j=2, k=3;

 

int m = i-- - j-- - k--;

 

System.out.println("m="+m);

}

}

2 / 10

What will be the output of the below program?

class IncrementDecrement11

{

public static void main(String args[])

{

int a=4, b=2, c=8;

 

System.out.println(a % b + b % c + b / a + c / b);

 

}}

3 / 10

What will be the output of the following program?

public class IncrementDecrement9

{

public static void main(String[] args)

{

int x = 001, y=010, z=100;

 

int i = - -x + y++ - z-- - --z + ++y - --x + y-- - --x;

System.out.println("i="+i);

}

}

4 / 10

What will be the output of the following program?

public class IncrementDecrement8

{

public static void main(String[] args)

{

int m=1010, n=1010;

 

System.out.println(m++ / ++n * n-- / --m);

}

}

5 / 10

What will be the output of the following program?

public class IncrementDecrement7

{

public static void main(String[] args)

{

int a=1;

 

a = a++ + ++a * --a - a--;

 

System.out.println(a);

}

}

6 / 10

Guess the value of in the below program?

public class IncrementDecrement6

{

public static void main(String[] args)

{

int m = 0, n = 0;

 

int p = --m * --n * n-- * m--;

System.out.println(p);

}

}

7 / 10

What will be the output of the following program?

public class IncrementDecrement5

{

public static void main(String[] args)

{

int a=1, b=2;

 

System.out.println(--b - ++a + ++b - --a);

}

}

8 / 10

What will be the output of the below program?

public class IncrementDecrement3

{

public static void main(String[] args)

{

int i=0;

 

i = i++ - --i + ++i - i--;

 

System.out.println(i);

 

}

}

9 / 10

What will be the output of the below program?

public class IncrementDecrement2

{

public static void main(String[] args)

{

int a=11, b=22, c;

 

c = a + b + a++ + b++ + ++a + ++b;

 

System.out.println("c="+c);

}

}

10 / 10

What will be the output of the below program?

public class IncrementDecrement1

{

public static void main(String[] args)

{

int i = 11;

 

i = i++ + ++i;

 

System.out.println(i);

}

}

Your score is

The average score is 78%

0%

Previous Post
Newer Post