执行语句Print"Sgn(-34)=";Sgn(-34)后,其输出结果为( )。

admin2010-09-11  32

问题 执行语句Print"Sgn(-34)=";Sgn(-34)后,其输出结果为(    )。

选项 A、Sgn(-34)=34
B、Sgn(-34)=-34
C、Sgn(-34)=+1
D、Sgn(-34)=-1

答案D

解析 本题使用Sgn函数来判断某数的正负号。当参数大于0时,返回1;当参数等于0时,返回0;当参数小于0时,返回-1。
转载请注明原文地址:https://kaotiyun.com/show/v3mp777K
0

随机试题
最新回复(0)