I have written the following code but not getting the correct the value of x. However we I remove semicolon from line2 it seems as if I am getting correct answer. But output