单选题 C语言
题号 #2546941

有以下程序:
#include<stdio.h>
main()
{  int k=-3:
if(k<=0)printf(”****\n”)
else printf(”&&&&\n”);
}
程序的输出结果是(  )。

进入在线模考

参考答案

D

答案解析

D。【解析】{intk=一3;if(k<=0)printf(”*”**\n”)elseprintf(”&&&&\n”);)中printf(”****\rl”)缺少分号,因此会报编译错误。

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考