Answer:
The value of var is 0
Step-by-step explanation:
Given:
The code snippet above
Required
Find the value of var after program execution
This line declares var as type integer
int var;
This line initializes var to -1
var = -1;
This line subtracts 1 from var; var - 1 = -1 -1 = -2
var = var - 1;
At this stage the value of var is -2
This line subtracts the value of var from var; i.e. -2 - (-2) = -2 + 2 = 0
var = var - var;
At this stage, the value of var is 0