C语言练习题-第三章答案.docVIP

  • 467
  • 0
  • 约9.62千字
  • 约 13页
  • 2016-12-26 发布于浙江
  • 举报
C语言练习题---第三章 1、有以下程序   #include<stdio.h   main()   {short c=124;   c=c_______;   printf(“%d\n”、C);   }   若要使程序的运行结果为248,应在下划线处填入的是 A)2 B)|248 C)&0248 D)1 2、以下程序运行后的输出结果是2008 。   #include<stdio.h   main()   {int a=200,b=010;   printf(”%d%d\n”,a,b);   } 3、有以下程序   #include<stdio.h   main()   {int x,y; scanf(”%2d%ld”,&x,&y); printf(”%d\n”,x+y);   } 程序运行时输入:1234567程序的运行结果是34579 。 4、有以下程序 #include stdio.h Void main() { char a,b,c,d; scanf(”%c%c”,a,b); c=getchar(); d=getchar(); printf(”%c%c%c%c\n”,a,b,c,d); } 当执行程序时,按下列方式输入数据(从第一列开始,CR代表回车,注意:回车是一个字符) 12CR 34CR 则输出结果是:

文档评论(0)

1亿VIP精品文档

相关文档