以下程序的输出结果是______。 include define FUDGE(y)2.84+y define PR(a)printf("以下程序的输出结果是______。 #include<stdio.h> #define FUDGE(y) 2.84+y #define PR(a) printf("%d",(int)(a)) #define PRINT() PR(s) ;putchar('\n') main() { intx=2; PRINT1 (FUDGE(5)*x); }A.11B.12C.13D.1

题目
以下程序的输出结果是______。 include define FUDGE(y)2.84+y define PR(a)printf("

以下程序的输出结果是______。 #include<stdio.h> #define FUDGE(y) 2.84+y #define PR(a) printf("%d",(int)(a)) #define PRINT() PR(s) ;putchar('\n') main() { intx=2; PRINT1 (FUDGE(5)*x); }

A.11

B.12

C.13

D.15


相似考题
更多“以下程序的输出结果是______。 #include<stdio.h> #define FUDGE(y)2.84+y #define PR(a)printf(" ”相关问题
  • 第1题:

    下列程序的输出结果是______。includedefine FUDGE(y)2.84+ydefine PR(a)printf("%d"

    下列程序的输出结果是______。#include<stdio.h>#define FUDGE(y) 2.84+y#define PR(a) printf("%d",(int)(a))#define PRINTl(a) PR(a);putchar('\n')main (){ int x=2; PRINT1(FUDGE(5)*x);}

    A.11

    B.12

    C.13

    D.15


    正确答案:B

  • 第2题:

    在C程序中如果要使用数学函数,如sin(x),log(x)等,需要在程序中加入的语句是

    A.#include <math.h>

    B.#include <stdio.h>

    C.#define <math.h>

    D.#define <stdio.h>


    C

  • 第3题:

    6、用scanf和printf函数时要用以下哪个语句导入头文件?

    A.#include<std.h>

    B.#include<stdio.h>

    C.#define<stdio.h>

    D.#include stdio.h


    stdio.h

  • 第4题:

    以下程序的输出结果是【 】。 include main() { intn=12345, d; while(n!=O){d=n%10; pr

    以下程序的输出结果是【 】。

    include <stdio.h>

    main()

    { int n=12345, d;

    while(n!=O){ d=n%10; printf("%d",d); n/=10; }


    正确答案:54321
    54321 解析:本题考查的知识点是:%运算和/运算。%运算要求两个运算分量均为整数,该运算计算两个整数相除得到的余数,该操作也叫做求模。所以,在while循环中, d=n%10;语句每次求得的结果是n个位上的数值,例如12345÷10所得的余数就是个位上的5。接下来输出得到的个位数字d,然后执行n/=10;语句,该语句等价于n=n/10;。在C语言中,如果/运算的两个运算分量都是整数,那所得的结果也截尾取整,所以 12345/10=1234,即n=n/10;语句的作用是让n截去个位上的数字。由此可知,随着while循环的继续,n依次为12345、1234、123、12、1,而每次输出n的个位数字将为5、 4、3、2、1。故本题应填54321。

  • 第5题:

    在C程序中如果要使用数学函数,如sqrt(x),pow(x,y)等,需要在程序中加入的语句是______

    A.#define <math.h>

    B.#define <stdio.h>

    C.#include <stdio.h>

    D.#include <math.h>


    C