What is the value of the var variable after the execution of the following snippet of code:int var,var = -1;var = var + 1;var = var + var;
Answers
Answered by
2
Answer:
var = -1
then var = var + 1 => var = -1 + 1 = 0
then var = var + var
so var will be 0 + 0
The final value of var is zero
Similar questions