In the following Pascal program segment, what is the value of X after the…

PYQ GATE 1995

In the following Pascal program segment, what is the value of X after the execution of the program segment?

X:=-10; Y:=20;

If X > Y then if X < 0 then X:=abs(X) else X:=2*X;

  1. A.

    10

  2. B.

    -20

  3. C.

    -10

  4. D.

    None

Attempted by 134 students.

Sign up free to check your answer

Sign up free

Explore the full course: Algorithms

Loading lesson…