What is the output of the following code? [code]q=0;syms p,q[/code]

What is the output of the following code?
Code:
q=0;syms p,q
A. q=0
B.
p
q=0
C.
p
q
D. Error
 
Answer: b
Explanation: The scope of the syms command ends when the input is a comma or a semi-colon. q is already declared to 0. q is not taken input as a symbolic variable. There would’ve been an error while trying to define q after a comma but it does not occur since it was already declared as an integer variable.
Output:
p
q=0
 

Tìm kiếm

Back
Top