What is the output of the following code? [code]if() p=9; end[/code]

Đinh Yến

New member
What is the output of the following code?
Code:
if()
p=9;
end
A. Error
B. p=9
C. Output is suppressed but p=9
D. 0
 
Answer: a
Explanation: We cannot keep the condition as empty. We need to give a condition otherwise control will never proceed to allow us to design the if structure. It will show an error as soon as we hit enter after if(). The output could’ve been 9 and it would’ve been suppressed due to the ‘’, but this code will show an error.
 

Tìm kiếm

Back
Top