有以下程序: #include #define PT 3.5; #define S(x)*x*x main() { int a=1,b=2; prinff(“%4.1f\n”,S(a+b));

admin2020-05-19  25

问题 有以下程序:
    #include
    #define PT 3.5;
    #define S(x)*x*x
    main()
    {
    int a=1,b=2;
    prinff(“%4.1f\n”,S(a+b));
    }
程序运行后的输出结果是(    )。

选项 A、31.5
B、7.5
C、程序有错无输出结果
D、14.0

答案C

解析 宏定义不是C语句,结尾不加“;”,所以该程序会出现编译错误,答案选C。
转载请注明原文地址:https://kaotiyun.com/show/SACp777K
0

相关试题推荐
最新回复(0)