Computer Applications
Evaluate the following expression if the value of x=2, y=3 and z=1. v=x + --z + y++ + y
Java Operators
ICSE 2019
43 Likes
Answer
v = x + --z + y++ + y
⇒ v = 2 + 0 + 3 + 4
⇒ v = 9
Answered By
29 Likes
Related Questions
Write a difference between unary and binary operator.
if (a>b&&b>c) then largest number is:
- b
- c
- a
- wrong expression
If
x = 5
andy = 4
, what will be the output of the following code?x += ++y - x-- + y++; System.out.println("x = " + x); System.out.println("y = " + y);
A student executes the following code to increase the value of a variable ‘x’ by 2.
He has written the following statement, which is incorrect.
x = +2;
What will be the correct statement?
A. x +=2;
B. x =2;
C. x = x +2;- Only A
- Only C
- All the three
- Both A and C