in Technology by

Evaluate the following Java expression, if x=3, y=5, and z=10:

++z + y - y + z + x++

a) 24

b) 23

c) 20

d) 25

🔗Reference: stackoverflow.com

🔗Source: Java Interview Questions and Answers

1 Answer

0 votes
by

Answer: (a) 24

Explanation: In the above expression, ++z means that the value will first increment by 1, then used. Now, evaluate the statement by putting the values of x, y, and z. On calculating the final answer is 24, as shown below.

++z +y -y +z + x++
11 + 5 - 5 + 10 + 3 = 24

Hence, the correct answer is option (a).

Related questions

0 votes
    Two coils X and Y have self-inductances of 5 mH and 10 mH and mutual inductance of 3 mH. If the current ... for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 12, 2021 in Education by JackTerrance
0 votes
    Two integers xandy are chosen with replacement out of the set {0,1,,2,3,10} . Then find the probability that |x-y ... 25 121 D. 20 121 Select the correct answer from above options...
asked Nov 15, 2021 in Education by JackTerrance
0 votes
    What is the output of the following expression? function multi(x,y) { var c = x*y; } multi(20,3); 1. 20 2. 60 3. 3 4. Nothing...
asked Feb 25, 2021 in Technology by JackTerrance
0 votes
    What is the output of the following expression? function multi(x,y) { var c = x*y; } multi(20,3); A) 20 B) 60 C) 3 D) Nothing...
asked Oct 9, 2020 in Technology by JackTerrance
0 votes
    1. Predict the output of the following operations if x=5 and y=3. x>=10&& y>=4 f. x>=1 || y>=4 Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    int x =20, y = 10, z; What is the value of z in z = ++x * (y – –) – y ? Show the steps. Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    Calculate the charge density when a potential function x^2 + y^2 + z^2 is in air(in ... theory proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
0 votes
    If XandY are independent binomial vatiates B(5, 1 2 )andB(7, 1 2 ) and the value of P(X+Y=3) is A. 35/47 ... 1024 C. 220/512 D. 11/204 Select the correct answer from above options...
asked Nov 16, 2021 in Education by JackTerrance
0 votes
    If a resistor Rx is connected between nodes X and Y, Ry between X and Y, Rz between Y and Z to form a ... Questions for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 20, 2021 in Education by JackTerrance
...