题目
有以下程序
#include <stdio.h>
#include <string.h>
main()
{ printf("%d\n",strlen ("ATS\n012\1") ); }
程序运行后的输出结果是
A)3
B)8
C)4
D)9
第1题
有以下程序 #include <stdio .h> main () { printf("%d\n", NULL); }
A.0
B.1
C.-1
D.NULL没定义,出错
第2题
有以下程序:#include <stdio, h>void sum(int a[ ] ){ a[0]=a[-1] +a[1];}main (){ int a[10] = {1,2,3,4,5,6,7,8,9,10}; sum(&a[2]); prinff("% d \n",a[2]); }程序运行后的输出结果是()。
A.6
B.7
C.5
D.8
第3题
有以下程序: #include <stdio, h> main () { int a =666,b =888; printf("%'d \n", a,b); 程序运行后的输出结果是()。
A.错误信息,
B.666
C.888
D.666,888
第4题
有以下程序:#include <stdio, h>main(){ char a1 ='M',a2 ='m'; printf("%c\n",(a1,a2)); } 以下叙述中正确的是()。
A.程序输出大写字母M
B.程序输出小写字母m
C.格式说明符不足,编译出错
D.程序运行时产生出错信息
第5题
有以下程序: #include <stdio, h> main() { int m =0256,n =256; printf("% o % o \n" ,m,n); 程序运行后的输出结果是() 。
A.0256 0400
B.0256 256
C.256 400
D.400 400
第6题
有以下程序:#include <stdio, h>#define f(x) (x * x)main (){ int i1 ,i2; i1 = f(8)/f(4) ;i2 =f(4 +4)/f(2 +2); printf("% d,% d\n" ,i1 ,i2);
A.64,28
B.4,4
C.4,3
D.64,64
第7题
有以下程序:#include <stdio, h>#include <string, h>struet STU{ int nam; float TotalSeore;};void f(strnct STU p){ struct STU s[2] = { {20044,550} ,{20045,537} }; p.num = s [1]. num; p.TotalScore = s [1]. TotalScore;main(){ struct STU s[2] = {{20041,703} ,{20042,580}}; f(s[0] ); printf("%d %3.Of\n" ,s[0].num,s[0].TotalSeore); }程序运行后的输出结果是()。
A.20045 537
B.20044 550
C.20042 580
D.20041 703
第8题
有以下程序: #include <stdio, h>main () { int k=5,n =0; while (k>0) { switch (k) { default: break; case 1 : n+ =k; case 2 : case3 : n+ =k; } k--; printf("% d \n" ,n);}程序运行后的输出结果是()。
A.0
B.4
C.6
D.7
第9题
有以下程序:#include <stdio, h>void fun(iht * a,int i,int j){ int t; if(i < j) { t=a[i];a[i] =a[j] ;a[j]=t; i++;j--; fun(a,i,j);main () int x[ ]: {2,6,1,8} ,i; fun(x,0,3); for(i=0;i <4;i ++ ) printf("%2d" ,x[i] ); printf(" \n");
A.1268
B.8621
C.8162
D.8612
第10题
有以下程序:#include <stdio, h>main() { char c1='1',c2='2'; c1=getchar();c2=getchar();putchar(c1);putchar(c2); } 当运行时输入:a<回车>后,以下叙述正确的是()。
A.变量c1被赋予字符a,c2被赋予回车符
B.程序将等待用户输入第二个字符
C.变量c1被赋予字符a,c2中仍是原有字符2
D.变量c1被赋予字符a,c2中将无确定值
第11题
有以下程序: #include <stdio, h>int a =2;int f(int n){ static int a: 3; int t=0; if(n%2){ static int a=4;t+ =a++;} else { static int a=5;t+ :a++;} return t + a + +;main (){ int s=a,i; for(i=0;i<3;i++)s + =f(i); prinff("% d \n" ,s); }程序运行后的输出结果是()。
A.26
B.28
C.29
D.24
为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!