[试题]

有以下程序

#include <stdio.h>

typedef struct

{ int num;double s ; }REC;

void fun1( REC x ){x.num=23; x.s=88.5;}

main()

{ REC a={16,90.0 };

fun1(a);

printf("%d/n",a.num);

}

程序运行后的输出结果是 ( 1 4 ) 。

参考答案与解析:

相关试题

(37)有以下程序#include <stdio.h>struct ord{ i

[单选题](37)有以下程序#include <stdio.h>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));}程序运行后的输出结果是A.)1,2B.)4,1C.)3,4D.)2,3

  • 查看答案
  • (37)有以下程序 #include <stdio.h> struct ord

    [单选题](37)有以下程序#include <stdio.h>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);}程序的运行结果是A.)1,2 B)2,3 C)3,4 D)4,1

  • 查看答案
  • 有以下程序#include <stdio.h>main(){struct STU

    [单选题]有以下程序#include <stdio.h>main(){struct STU { char name[9]; char sex; double score[2];};struct STU a={"Zhao",'m',85.0,90.0},b={"Qian",'f',95.0,92.0};b=a;printf("%s,%c,%2.0f,%2.0f/n", b.name, b.sex, b.score[0], b.score[1]);}程序的运行结果是A.)Qia

  • 查看答案
  • 有以下程序<br />#include <stdio.h><br />typedef struct { int b, p; } A;<br />void

    [单选题]有以下程序#include typedef struct { int b, p; } A;void f(A c)  /* 注意:c是

  • 查看答案
  • 有以下程序#include <stdio.h>struct tt{ int x;

    [单选题]有以下程序#include <stdio.h>struct tt{ int x;struct tt *y;} *p;struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a};main(){ int i;p=a;for(i=1;i<=2;i++) {printf("%d,",p->x); p=p->y;}}程序的运行结果是A.)20,30,B.)30,17C.)15,30,D.)20,15,

  • 查看答案
  • 有以下程序#include <stdio.h>struct st{ int x,

    [单选题]有以下程序#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.h>struct ord{ int x

    [单选题]有以下程序#include <stdio.h>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);}程序的运行结果是A.)1,2B.)2,3C.)3,4D.)4,1

  • 查看答案
  • 有以下程序#include <stdio.h>struct stu{ int n

    [单选题]有以下程序#include <stdio.h>struct 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.

  • 查看答案
  • 有以下程序#include <stdio.h>struct st{int x,

    [单选题]有以下程序#include <stdio.h>struct 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

  • 查看答案
  • (38)有以下程序#include <stdio.h>struct S{ int

    [单选题](38)有以下程序#include <stdio.h>struct 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

  • 查看答案
  • 有以下程序#include <stdio.h>typedef struct{ i