单选题有以下程序:#include struct S{ int a,b;}data[2]={10,100,20,200};main(){ struct S p=data[1]; printf(%d,++(p.a));}程序运行后的输出结果是(  )。A10B11C20D21

单选题
有以下程序:#include struct S{ int a,b;}data[2]={10,100,20,200};main(){ struct S p=data[1]; printf(%d,++(p.a));}程序运行后的输出结果是(  )。
A

10

B

11

C

20

D

21


参考解析

解析:
题中定义了一个包含两个元素的结构体数组,其中data[0].a=10,data[0].b=100,data[1].a=20,data[1].b=200。指针p指向结构体数组的第2个元素,那么p.a的值为20,++(p.a)的值为21,所以输出结果为21。答案选择D选项。

相关考题:

有以下程序#include stdio.hstruct st{ int x,y;} data[2]={1,10,2,20};main(){ struct st *p=data;printf("%d,",p-y); printf("%d\n",(++p)-x);}程序的运行结果是A)10,1B)20,1C)10,2D)20,2

有以下程序:struct s{ int x,y; }data[2]={10,100,20,200};main(){ struct s *p=data;printf("%d\n",(++p)-x);}程序运行后的输出结果是( )。A.10 B.11 C.20 D.21

有以下程序 include typedef struct { int num;double s; }REC; void funl(REC *x) { x 有以下程序 include<stdio.h> typedef struct { int num;double s; }REC; void funl(REC *x) { x->num=23;x->s=88.5; } void main() { REC a={16,90.0}; fun1(A); printf("%d\n",a.num); } 程序运行后的输出结果是( )。

下列程序的输出结果是()。includestruct abc{int a, b, c, s;};main(){struct abc s[2] 下列程序的输出结果是( )。 #include <stdio.h> struct abc { int a, b, c, s;}; main() { struct abc s[2]={{1,2,3},{4,5,6}}; int t; t=s[0].a+s[1].b; printf("%d\n",t); }A.5B.6C.7D.8

有以下程序: include struct STU {int num; float TotalScore; 有以下程序: #include <strino.h> struct STU {int num; float TotalScore; }; void f(struct 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.0t\n",s[0].num,s[0].TotalScore); } 程序运行后的输出结果是 ______。A.20045 537B.20044 550C.20042 580D.20041 703

有以下程序: include struct STU (char name[10]; int num; }; 有以下程序: #include <string.h> struct STU (char name[10]; int num; }; void f(char *name, int num) {struct STU s[2]={{"SunDan",20044}.{"Penghua",20045}}; num=s[0].num; strcpy(name,s[0].name); } main() {struct STU s[2]={{"YangSall",20041},{"LiSiGao",20042}},*p;p=s[1]; f(p->name,p->num); printf("%s%d\n",p->name,p->num); } 程序运行后的输出结果是 ______。A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

有以下程序 include struct st { int x,y;} data[2]={1,10,2,20}; main( 有以下程序 #include <stdio.h> struct st { int x,y;} data[2]={1,10,2,20}; main() { struct st *p=data; printf("%d,",p->y); printf("%d\n",(++p)->x); } 程序的运行结果是______。A.10,1B.20,1C.10,2D.20,2

有以下程序#include stdio.hstruct stu{ int num; char name [10];int age;};Void fun(struct stu *p){ printf("%s\n,p-name);}main( ){ struct stu x[3]={ {01,”Zhang”,20},{02, ” Wang”,19},{03, ”zhao”,18} };fun(x+2);}程序运行后的输出结果是A)ZhangB)ZhaoC)WangD)19

有以下程序#include stdio.hstruct st{ int x, y, z;} data[2]={3,10,2,20,15,7};main(){ struct st *p=data; printf("%d,", p-y); printf("%d\n",(++p)-x); }程序的运行结果是A.10,3 B.20,3 C.10,20 D.20,2

有以下程序:#includestdio.hstruct S{int a,b;)data[2]=10,100,20,200);main( ){struct S p=data[l];printf(%d\n,++(p.a));}程序运行后的输出结果是( )。A.10B.11C.20D.21

以下程序的输出结果是( )。include struct s { int x,y; } a[2]={10,100,20,200}; main() { struct s *p=data; printf("%d\n",++(p->x)); } A、10B、11C、20D、21

有以下程序:include include struet STU{ int nam;float TotalSeore;};v 有以下程序:#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 537B.20044 550C.20042 580D.20041 703

有以下程序:includeinclude struct STU {char name[10];int hum;};void f( 有以下程序:#include <stdio.h>#include <strine.h> struct STU { char name[10]; int hum;};void f(char * name,iht num){ struct STU s[2] = {{ "SunDan" ,20044} , {" Penghua" ,20045}}; num= s[0]. nnm; strepy(name,s[0], name);}main( ){ struct STU s[2] = {{"YangSan" ,20041 }, { "LiSiGao" ,20042}}, * P; p = s[1]; f(p->name,p->hum); printf("% s %d \n" ,p-> name,p->num);}程序运行后的输出结果是( )。A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

有以下程序 struct s { int x,y; } data[2]={10,100,20,200}; main() struct s *p=data; printf("%d\n",++(p->x)); 程序运行后的输出结果是A.10B.11C.20D.21

有以下程序#includestdio.hstruct S{int a,b;} data[2]={10,100,20,200};main(){struet S p=data[l];printf(“%d\n”,++(P.a)):}程序运行后的输出结果是A.10B.11C.20D.21

(38)有以下程序#include stdio.hstruct S{ int a,b;}data[2]={10,100,20,200};main(){ struct S p=data[1];printf("%d\n",++(p.a));}程序运行后的输出结果是A)10B)11C)20D)21

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

单选题有以下程序:#include struct STU{ int num; float TotalScore;};void f(struct 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.0f, s[0].num, s[0].TotalScore);}程序运行后的输出结果是(  )。A20045 537B20044 550C20042 580D20041 703

单选题有以下程序:#include struct S{ int x,y;};main(){ struct S data[3] = {4,3,2,0,8,1}; int i; for(i=0;i3;i++)  printf(%d%d;,data[i].x, data[i].y1); printf();}程序运行后的输出结果是(  )。A41;20;80;B41;22;64;C40;21;80;D43;20;81;

单选题有以下函数:#include struct stu{ int num; char name[10]; int age;};void fun(struct stu *p){ printf(%s, p-name);}main(){ struct stu x[3] = {{01,Zhang,20}, {02,Wang,19}, {03,Zhao,18}}; fun(x+2);}程序运行后的输出结果是(  )。AZhangBZhaoCWangD19

单选题有如下程序:#include #include struct S{ char name[10];};void change(struct S *data,int value){ strcpy(data-name, ****); value=13;}main(){ struct S input; int num = 4; strcpy(input.name, THIS); change(input,num); printf(%s,%d,input.name,num);}程序运行后的输出结果是(  )。A****,4B****,13CTHIS,4DTHIS,13

单选题有以下程序:#include struct st{ int x,y;} data[2]={1,10,2,20};main(){ struct st *p=data; printf(%d,,p-y); printf(%d,(++p)-x);}程序运行的结果是(  )。A10,1B20,1C10,2D20,2

单选题有以下程序#include #include struct S{ char name[10];};void change(struct S *data, int value){ strcpy(data-name, #); value = 6;}main(){ struct S input;  int num = 3; strcpy(input.name, OK); change(input, num); printf(%s,%d, input.name, num);}程序运行后的输出结果是(  )。AOK,6B#,6COK,3D#,3

单选题有以下程序:#include #include struct S{ char name[10];};main(){ struct S s1,s2; strcpy(s1.name,12345); strcpy(s2.name,ABC); s1=s2; printf(%s,s1.name);}程序运行后的输出结果是(  )。AABC12BABC45C12345DABC

单选题有如下程序:#include struct S{ int x,y;};main(){ struct S data[2] = {4,3,1,9}; int i; for(i=0;i2;i++)  printf(%d,%d;,data[i].x, data[i].y1);}程序运行后的输出结果是(  )。A4,1;1,4;B4,1;2,4;C4,3;1,9;D4,3;2,3;

单选题有以下程序:#include #include struct S{ char name[10];};main(){ struct S s1,s2; strcpy(s1.name,XXX); strcpy(s2.name,=); s1=s2; printf(%s,s1.name);}程序运行后的输出结果是(  )。A=BXXXC=XXDX=

单选题有以下程序:#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,p-next-n);}程序运行后的输出结果是(  )。A2,3B2,4C3,4D4,6