What is the output of the following code? [code]p=input[''];[/code]

What is the output of the following code?
Code:
p=input[''];
A. Asks for an input
B. Error in the input
C. Error due to syntax
D. Cannot be determined
 
Answer: c
Explanation: There is a syntactical error in the above code. This is because we’ve given [] after the input command but the syntax of the input command requires us to put parentheses after it. This leads to an error.
 

Tìm kiếm

Back
Top