有下列程序:
#include<stdi0.h>
structst
{intx,Y,date[2]={1,10,2,20};
voidmain( )
{structst*p=date;
printf("%d,",p->y);printf("%d\n",(++p)
->x);
}
程序的运行结果是( )。
A.10,1
B.20,1
C.10,2
D.20,2
第1题:
有如下程序 #include<iostream.h> int func(int a,int b) {return(a+b);} void main() { int x=2,y=5,z=8,r; r=func (func (x,y),z); cout<<r; 该程序的输出的结果是
A.12
B.13
C.14
D.15
第2题:
有下列程序: #include<stdi0.h> structst {intx,Y,date[2]={1,10,2,20}; voidmain( ) {structst*p=date; printf("%d,",p->y);printf("%d\n",(++p) ->x); } 程序的运行结果是( )。
A.10,1
B.20,1
C.10,2
D.20,2
第3题:
有以下程序 #include<iostream.h> floatfun(int x,int y) {return(x+y);} void main() {int a=2,b=5,c=8; tout<<fun((int)fun(a+c,b),a-C);} 程序运行后的输出结果是
A.编译出错
B.9
C.21
D.9
第4题:
有以下程序 #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,1
B.20,1
C.10,2
D.20,2
第5题:
有以下程序 #include<iostream.h> float fun(int x,int y) {return(x+y);} void main() {int a=2,b=5,c=8; cout<<fun((int)fun(a+c,b),a-c);} 程序运行后的输出结果是( )。
A.编译出错
B.9
C.21
D.9