What is the output of the following code? [code]meansqr(NaN)[/code]

What is the output of the following code?
Code:
meansqr(NaN)
A. 0
B. NaN
C. Error
D. 1
 
Answer: a
Explanation: The fuction meansqr() returns the mean of the square of all finite value inputs. Since NaN is not a finite valued input, there are no other finite valued elements in the input. Hence the result is 0.
Output: 0
 

Tìm kiếm

Back
Top