Compiler-Design
December 30, 2023
Aptitude
December 31, 2023
Compiler-Design
December 30, 2023
Aptitude
December 31, 2023

Programming

Question 11

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;

A
10
B
-20
C
-10
D
None
Question 11 Explanation: 
X is remains unchanged. As the if condition is becomes false.
X = -10
Correct Answer: C
Question 11 Explanation: 
X is remains unchanged. As the if condition is becomes false.
X = -10

Leave a Reply

Your email address will not be published. Required fields are marked *