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

有以下程序: #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); } 程序运行后的输出结果是( )。

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

正确答案
B

试题解析
fun(x+2)表示的是结构体数组中的第3个元素即{03,"Zhao",l8),而输出的是name元素,所以答案为B。

标签:
感兴趣题目
有以下程序: #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> int f(int x): main {int n=1,m; m=f(f(f(n)));printf("%d ",m); } int f(int x) {return x*2;) 程序运行后的输出结果是( )。
有以下程序: #include <stdio.h> struct s { int x,y;} data[2]={10,100,20,200}; main() { struct s *p=data; printf("%d ",++(p->x)); 程序运行后的输出结果是( )。
有以下程序段 #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> main() { int a=5,b=lt; t=(a<<2)|b;printf("%d ",t); } 程序运行后的输出结果是______。
有以下程序:
#include<stdio.h>
#include<string.h>
main(  )
{printf{"%d",strlen("%d",strlen("ATS0121"));}   
程序运行后的输出结果是(  )。
相关题目
下述程序的输出结果是( )。 #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> 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> #define N l0 void fun(int x[N]) {int i=O; while(i<N)scanf("%d",___ ); } 在程序中下划线处应填人的是( )。
有以下程序: #include<stdio.h> main { short C=124; C=C_; printf("%d ",c); } 若要使程序的运行结果为248,应在下划线处填入的是( )。
有以下程序 #include<stdio.h> struct ord { int x,y;} dt[2]={1,2,3,4}; mare() { struct ord*p=dt; printf("%d,",++p->x); printf("%d ",++p->y); } 程序的运行结果是______。
以下程序的运行结果是( )。 #include <stdio.h> main() { st,uct date {int year,month,day;}today; printf("%d ",sizeof(struct date)); }
有以下程序:#include main(){ int sum=0,x=5; do{ sum+=x; } while(!--x); printf(%d,sum);}程序的运行结果是(  )。
以下程序的输出结果是 ( ) #include<stdio.h> main() {struct stru{int a,b: char c[6]; }: printf("%d ",sizeof(stru)), }
有以下程序:#include main(){ int x=011; printf(%d,++x);}程序运行后的输出结果是(  )。
有以下程序(其中k的初值为八进制数):#include main(){ int k=011; printf(%d,k++);}程序运行后的输出结果是(  )。
有以下程序:#include main(){ int a=3; int b=3; printf(%d, a&b);}程序运行后的输出结果是(  )。
有以下程序:#includestruct S{int a;int *b;};main(){ int x1[] = {3,4},x2[] = {6,7}; struct S x[] = {1,x1,2,x2}; printf(%d,%d,*x[0].b,*x[1].b);}程序的运行结果是(  )。
有下列程序: #include<stdio.h> main { int x=0; int y=0; while(x<7 &&++v) { y--; x++;} printf("%d,%d",y,x); } 程序的输出结果是( )。
有以下程序: #include<stdio.h> main( ) { int a=-2,b=0; while(a++++b); printf("%d,%d ",a,b); } 程序运行后的输出结果是( )。
有以下程序: #include<stdio.h> #define N 8 void fun(int*x,int i) {*x=*(x+i);) main( ) { int a[N]={1,2,3,4,5,6,7,8},i; fun(a,2); for(i=0;i<N/2;i++) {printf("Ha",a[i]);} printf(" "); } 程序运行后的输出结果是( )。
有以下程序#include main(){ int i=1; i=i^i; printf(%d,i);}程序运行后的输出结果是(  )。
有以下程序:#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 " ,p-> name,p->num);}程序运行后的输出结果是( )。
有以下程序: #include <stdio.h> main( ) { int a=7; while(a--); print[("%d ",a); } 程序运行后的输出结果是( )。
广告位招租WX:84302438

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