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;
Answer of $X$ remains unchanged. As the if condition becomes false.
X := -10
Answer is C . This is classic example of $if-else$ issue. Always $else$ matches for nesting to the closest $if$ in $C$ Programming & Pascal .