What is the output of the following code? [code] a=10; b=10; c=’pi’; whos[/code]

What is the output of the following code?
Code:
 a=10; b=10; c=’pi’; whos
A. The output will show all double variables
B. The output will show a and b as double and c as symbolic object
C. The output will show a and b as symbolic object and c as char
D. The output will show a and b as double variables and c as char variables
 
Answer: d
Explanation: ‘a’ and ‘b’ will be stored as double variables with a=10 and b=10 while c will be stored as a character variable as c=pi.
Output:
Name Size Bytes Class Attributes
a 1x1 8 double
b 1x1 8 double
c 1x2 4 char
 

Tìm kiếm

Back
Top