题目内容

有以下程序,程序运行后的输出结果是( )#include #include structA{inta;charb[10];doublec;}struct A f(struct A t);main(){structA a={1001,"ZhangDa",1098.0};a=f(a);printf("%d,%s,%6.1f\n",a.a,a.b,a.c);}struct A f(struct A t){t.a=1002;strcpy(t.b,"ChangRong");t.c=1202.0;return t;}

A. 1001,ZhangDa,1098.0
B. 1022,ZhangDa,1202.0
C. 1001,ChangRong,1098.0
D. 1002,ChangRong,1202.0

查看答案
更多问题

设有定义:struct complex{int real,unreal;}data1={1,8},data2;则赋值语句中错误的是( )

A. data2=data1;
B. data2=(2,6);
C. data2.real=data1.real;
D. data2.real=data1.unreal;

有以下程序:#include void main(){unsigned char a=8,c;c=a>>3;printf("%d\n",c);}程序运行后的输出结果是()

A. 16
B. 1
C. 32
D. 0

有以下程序,程序运行后的输出结果是()#include void main(){unsigned char a=2,b=4,c=5,d;d=a|b;d&=c;printf("%d\n",d);}

A. 3
B. 4
C. 5
D. 6

有以下程序,程序运行后的输出结果是()#include void main(){int a=2,b;b=a<<2;printf("%d\n",b);}

A. 2
B. 4
C. 6
D. 8

答案查题题库