首页 试题详情
单选题

下列程序的输出结果是()。 struct abc { int a, b, c; }; main() { struct abc s[2]={{1,2,3},{4,5,6}}; int t; t=s[0].a+s[1].b; printf("%d \n",t); }

A5

B6

C7

D8

正确答案:A (备注:此答案有误)

相似试题

  • 单选题

    下列程序输出结果是struct abc{ int a, b, c; };main(){ struct abc s[2]={{1,2,3},{4,5,6}}; int t;t=s[0].a+s[1].b;printf(%d n,t);}

    答案解析

  • 单选题

    有以下程序  #include   struct ord  { int x,y;}dt[2]={1,2,3,4};  main()  {  struct ord *p=dt;  printf(%d,,++(p->x)); printf(%d n,++(p->y));  }  程序运行后输出结果是

    答案解析

  • 单选题

    8、 有以下程序struct STU{char name[10];int num;};void f1(struct STU c){ struct STU b={LiSiGuo,2042};c=b;}void f2(struct STU *c){ struct STU b={SunDan,2044}; *c=b;}main( ){ struct STU a={YangSan,2041},b={WangYin,2043}; f1(a);f2(&b); printf(%d %d n,a.num,b.num);} 执行后输出结果是

    答案解析

  • 单选题

    以下C语言程序输出结果是struct s{int x,y;}data[2]={10,100,20,200};main( {struct s*p=data;p++;printf(“%d n”,++(p->x;}

    答案解析

  • 单选题

    有以下程序#include main(){struct node{int n;struct node *next;} *p;struct node x[3]={{2,x+1},{4,x+2},{6,NULL}};p=x;printf(“%d,”,p->n);printf(“%d n”,p->next->n);}程序运行后输出结果是

    答案解析

热门题库