Computer Science, asked by warriorlion, 2 months ago

Find the value of B if A = 2. (i). B= A++ * A * ++A (ii). B= ++ A * A--​

Answers

Answered by anmolwajid03
1

Answer:

Find the value of B if A = 2. (i). B= A++ * A * ++A= 12 (ii). B= ++ A * A--​ = 6

Explanation:

Find the value of B if A = 2.

(i). B= A++ * A * ++A  //

As A++ will be post increment the value of A after execution in this step.

So A++ for this step will be 2,

But ++A is pre increment which will add one to the value of A before execution. Which will make ++A to be 3.

So; 2*2*3=12

(ii). B= ++ A * A--​  //3*2=6

++A will be 3 (pre increment)

A-- will be 2; post decrement

Similar questions