What is the difference between the two codes? [code]a> P=[91,’pi’]; b> Q=[91,pi];[/code]

What is the difference between the two codes?
Code:
a> P=[91,’pi’];
b> Q=[91,pi];
A. Code a initialises P as a character array while code b initialises Q as an integer array
B. Both P and Q will be integer arrays
C. Code b initialises P as a character array while code a initialises Q as an integer array
D. Both P and Q will be character arrays
 
Answer: a
Explanation: One should keep in mind that once while declaring a vector, a character is introduced with a pair of single-inverted commas, the vector becomes a character array. So it will show different answers while doing algebraic operations on it.
Output:
For a> P= [pi
b> Q= 91 3.1416
 

Tìm kiếm

Back
Top