首页/ 题库 / [单选题]有以下程序: #include<&的答案

有以下程序: #include<<stdio.h> struct stu { int num; char name[10]: int age;} void fun(struct stu*p) {printf("%s\n",(*p).name);} the main { struct stu students[3]={{9801,"Zhang".20}, {9802,"Wang",19},{9803,"Zhao",1 8}} fun(students+2); } 输出的结果是( )。

单选题
2022-06-02 12:08
A、Zhang
B、Zhao
C、Wang
D、18
查看答案

正确答案
B

试题解析
从实参传递过去的是结构体系数组的第3个元素,所以输出的name为Zhao。

标签:
感兴趣题目
有以下程序: #include<stdio.h> main( ) { int a=-2,b=0; while(a++++b); printf("%d,%d ",a,b); } 程序运行后的输出结果是( )。
有以下程序: #include <stdio.h> main( ) { int a=7; while(a--); print[("%d ",a); } 程序运行后的输出结果是( )。
有以下程序: #include<stdio.h> main( ) { char a=H; a=(a>=Aa<=2)?(a-A+a):a; printf("%c ",a); } 程序运行后的输出结果是( )。
有以下程序: #include <stdio.h> main( ) { int a=2,b; b=a<<2;printf("%d ",b); } 程序运行后的输出结果是( )。
有以下程序: #include<stdio.h> struct stu { int num;char name[l0];int age;}; void fun(struct stu*p) { printf("%s ",p->name);} main( ) { struct stu x[3]={{01,"Zhang",20),{02,"Wang",l9},{03,"Zha0",l8}}; fun(x+2); } 程序运行后的输出结果是( )。
以下程序的输出结果是______。#include<stdio.h>struct stu{ int num; char name[10]; int age;};void fun(struct stu*p){ printf("%s ",(*p).name);}main(){ struct stu students[3]={ {9801,"Zhang",20}, { 9802,"Wang",19}, { 9803,"Zhao",18} }; fun(students+2);}
有以下程序: #include<<stdio.h> struct stu { int num; char name[10]: int age;} void fun(struct stu*p) {printf("%s\n",(*p).name);} the main { struct stu students[3]={{9801,"Zhang".20}, {9802,"Wang",19},{9803,"Zhao",1 8}} fun(students+2); } 输出的结果是( )。
有以下程序段 #include<stdio.h> main( ) { . . .while(getchar( )!=\n); . . . } 以下叙述中正确的是( )。
有以下程序: #include<stdio.h> main( ) {char ch[3][5]={"AAAA","BBB","CC"}; printf("%s ",ch[l]); } 程序运行后的输出结果是( )。
有以下程序: #include<stdio.h> main( ) {int X=011; printf("%d ",++x); } 程序运行后的输出结果是( )。
有以下程序:
#include<stdio.h>
#include<string.h>
main(  )
{printf{"%d",strlen("%d",strlen("ATS0121"));}   
程序运行后的输出结果是(  )。
下列程序的输出结果是( )。 #include<stdio.h> main( ) { int i,S=0; for(i=1;i<10;i++) if(!(i%2)&&!(i%3))s+=i; printf("%d\n",s); }
相关题目
有如下程序: <br>#include<br>using namespace std;<br>int main()<br>{<br>int *p;<br>*p =9;<br>cout&lt;&lt;"The value at p:"&lt;&lt;*p;<br>return 0;<br>}<br> 编译运行程序将出现的情况是 <br>
有以下程序 #include<stdio.h> main( ) {char a[3O],b[30]; scanf("%S",a); gets(b); printf("%s %s\n",a,b); } 程序运行时若输入: how are you? I am fine<回车> 则输出结果是( )。
下述程序的输出结果是( )。 #include<stdio.h> main( ) {int i; for(i=1;i<=10;i++) {if(i*i>=20)(i*i<=lOO)) break; } printf("%d\n",i*i); }
下列程序的输出结果是( )。 #include<stdio.h> main { int i; for(i=1;i<=10,i++) { if((i*i>=20)&&(i*i<=100)) break; } printf("%d\n",i*i; }
有以下程序 #include<stdio.h> void fun(char**p) {++p;printf("%s",*p);} main {char*a[]={"Morning","Afternoon","Evening"," Night"); fun(a); } 程序的运行结果是( )。
有以下程序: #include<stdio.h> main( ) {int c=0,k; for(k=1;k<3;k++) switch(k) {default:c+=k; case2:c++;break; case4:c+=2;break; } printf("%d\n",c); } 程序运行后的输出结果是( )。
以下程序段给数组所有元素输入数据:
#include<stdio.h>main()
{int a[10],i=0;
while(i<10)scanf(”%d”,);
}
应在下划线处填入的是(  )。
有以下程序: #include<stdio.h> main { short C=124; C=C_; printf("%d ",c); } 若要使程序的运行结果为248,应在下划线处填入的是( )。
有以下程序. #include<stdio.h> main { char c1,c2,c3,c4,c5,c6; scanf("%c%c%c%c",&c1,&c2,&c3,&c4); c5=getchar; c6=getchar; putchar(c1);putchar(c2); printf("%c%c\n",c5,c6); } 程序运行后,若从键盘输入(从第l列开始) 123<回车> 45678<回车> 则输出结果是( )。
下列程序的执行结果为( )。 #include<iostream.h> void main { int a=3,b=0; int*P =&a; b=+a++; cout<<*P<<”,”<<b<<endl; }
下列程序的执行结果是( )。 #include<iostream.h> #include<stdlib.h> classTestClass { public: intX,y; TestClass(){x=y=0;} TestClass(inta,intb)(x=a;y=b;}voiddisp() { cout<<"x="<<x<<",y="<<y<<endl; } }; voidmain() { TestClasss1(2,3); s1.disp(); }
下面程序的运行结果为( )。 #include<iostream.h> voidmain() { chara=3: switch(a) { case3:cout<<"3"; case2:cout<<"2";break; default:cout<<"1"; } }
下列程序的执行结果是( )。 #include(iostream.h> #include<stdlib.h> classTestClass { public: intX,y; TestClass( ){x=y=0;} TestClass(inta,intb){x=a;y=b;} voiddisp( ) { cout<<"x="<<x<<",y="<y<<endl; } }; voidmain( ) { TestClasss1(2,3); s1.disp( ); }
有如下程序: #include<iostream> #includediomanip> usingnamespacestd; intmain( ){ ints[]={123,234); cout<<setfill(*)<<setw(6); for(inti=0;i<2;i++){cout<<s[i]<<endl;) return0; } 运行时的输出结果是( )。
下列程序的运行结果为( )。 #include<iostream.h> void print(double A. { cout<<++a: } void print(int atint B. { cout<<b<<a: } void main { print(1.2); eout<<””: print(3,4); }
下面程序的运行结果为( )。 #include<iostream.h> class A { public: A{tout<<”1”;} ~A{tout<<”2”;} }; class B:public A { public: B{cout<<”3”;} ~B{cout<<”4”;} }; void main { B b; }
下面程序的运行结果为( )。 #include<iostream.h> ClassA { public:A( ){cout<<"1";} ~A( ){cout<<"2";} }; ClassB:public:A { public: B( ){cout<<"3";} ~B( ){cout<<"4";} }; Voidmain( ) { Bb; }
下面程序的运行结果为( )。#include<iostream.h> voidswap(int&a,intb) { inttemp; temp=a++; a=b: b=temp: } voidmain() { inta=2,b=3; swap(a,b); cout<<a<<","<<b<<endl; }
当执行下面的程序时,如果输入ABC,则输出结果是( )。#include<stdio.h>#include<string.h>void main(){char ss[10]="12345",gets(ss);strcat(ss,"6789");printf("%s\n",ss);}A.ABC6789 B.ABC67 C.12345ABC6 D.ABC456789
有下列程序: #include<stdio.h> main { int x=0; int y=0; while(x<7 &&++v) { y--; x++;} printf("%d,%d",y,x); } 程序的输出结果是( )。
广告位招租WX:84302438

免费的网站请分享给朋友吧