background image

10、下面程序的输出结果是()。

int  m=13;

int  fun( int x,  int  y)

{ int m=3;

      return( x*y-m); }

main( )

{ int a=7,b=5;

 printf(“%d\n”, fun(a,b)/m); }

A) 1         B)  2        C) 3        D) 10

 

二、填空题。(每空 分,共 30

 

分)

1.设有变量说明语句:

     int x=1,y=2;
则执行下述 printf 语句的输出结果是______

            _____。

     printf("%f\n",1.0+x/y);

2.执行下述程序:

     #include <stdio.h>

     main()

     {

       int x,y;

       scanf("%2d%*2s%1d",&x,&y);

       printf("%d\n",x+y);

      }
若从键盘输入:

        12345671 
则程序的输出结果是________。
3.以下程序的功能是:从键盘上输入若干名学生的成绩(百分制,可带小数,以
输入负数或 0 为结束标志),统计并输出最高成绩和最低成绩。请填空。
    #include <stdio.h>

    main()

    {

      float x,amax,amin;