柠檬试题库
search
首页
计算机
公务员
驾照
关于
share
有以下程序 #include
int fun1( double a ) { return (int)(a*=a); } int fun2(double x, double y) { double a=0,b=0; a=fun1( x ); b=fun1( y ); return (int)(a+b); } main() { double w; w=fun2(1.1,2.0); printf("%4.2f", w); } 程序执行后输出结果是
A.0.0
B.5
C.5.21
D.5.00
热度🔥1,935
参考答案:D
解析:
【解析】题中变量w的定义为double型,函数fun2()的定义为int型,按照各类数值型数据间的混合运算,整型数据被转换为实型数据。因此D选项正确。
复制题目向AI提问
content_copy
content_copy
扫码免费计算机二级刷题
2025年计算机等级考试题库
推荐
有以下程序 #include main() { int a,b; for (a=0; a,则输出结果是
设有如下通用过程:Public Function Fun(xStr As String)As String Dim tStr As String, strL As Integer tStr="" strL=Len(xStr) i=strL / 2 Do While i<=strL tStr=tStr & Mid(xStr, i+1, 1) i=i+1 Loop Fun=tStr & tStrEnd Function在窗体上画一个名称为Text1的文本框和一个名称为Command1的命令按钮。然后编写如下的事件过程:Private Sub Command1_Click() Dim S1 As String S1="ABCDEF" Text1.Text=LCase(Fun(S1))End Sub程序运行后,单击命令按钮,文本框中显示的是( )。
下面描述中不属于数据库系统特点的是
小明的毕业论文分别请两位老师进行了审阅。每位老师分别通过Word的修订功能对该论文进行了修改。现在,小明需要将两份经过修订的文档合并为一份,最优的操作方法是( )。
标签
二级C语言
fun
double
int
数据