网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

下列程序的输出结果为

main ()

{

union u

{char *name;

int age;

int income;}s

s.name="WANGLIONG";

s.age=28;

s.income=1000;

printf("%d\n",s.age);

}

A.28

B.1000

C.0

D.不确定


参考答案

更多 “ 下列程序的输出结果为main (){union u{char *name;int age;int income;}ss.name="WANGLIONG";s.age=28;s.income=1000;printf("%d\n",s.age);}A.28B.1000C.0D.不确定 ” 相关考题
考题 下列程序的输出结果是()。includevoid fun(int*a,int*B){int *k;k=a;a=b;b=k;}main(){i 下列程序的输出结果是( )。 #include<stdio.h> void fun(int*a,int*B){ int *k; k=a;a=b;b=k;} main() { int a=1,b=2,*x=a,*y=b; fun(x,y); printf("%d%d",a,B); }A.2 1B.1 2C.编译出错D.0 0

考题 有以下程序:includeincludeusingnameSpacestd;classperson{ intage; Char*nam 有以下程序:include <iostream>include <string>using nameSpace std;class person{int age;Char * name;public:person ( int i, Char * str ){int j;j = strlen( str ) + 1;name = new char[ j ];strcpy( name, str );age = i;}~person(){delete name;cout<<"D";}void display(){cout<<name<<":"<<age;}};int main(){person demo( 30,"Smith" );demo.display();return 0;}则该程序的输出结果为:【 】。

考题 下列程序的输出结果是【 】。include void swap(int *a, int *B) { int *t; t=a;a=b;b=t; 下列程序的输出结果是【 】。include <stdio.h>void swap(int *a, int *B){int *t;t=a;a=b;b=t;}main(){int i=3,j=5,*p=i,*q=j;swap(p,q);printf("%d %d\n",*p,*q);}

考题 有以下程序: #includestdio.h #includestdlio.h void fun(int*pl,int*p2,int*s) { s=(int*)malloc(sizeof(int)); *s=*pl+*p2; free(s); } main( ) { int a=1,b=40,*q=&a; fun(a,b,q); printf("%d\n",*q); } 程序运行后的输出结果是( )。A.42B.0C.1D.41

考题 下列程序中,正确的为______。A.main() { int *pb=b; float 1>=15.25; print f("%d\n" ,*pb); }B.amin() { int a,*pa; a=10; *pa=a; prinffC%d",*pa); }C.main() { char s[20]; char *ps=s; scanf("%s",*p); printf("%s",*p); }D.main() { char str[10]; int *ps=str[0]; str="abcdefg"; printf("%s",*p); }

考题 下列程序的输出结果为 main() { union u {char *name; int age; int income;}s s.name="WANGLIONG"; s.age=28; s.income=1000; printf("%d\n",s.age); }A.28B.1000C.0D.不确定

考题 下列程序的输出结果是()。includemain(){ struct st{ int y, x,z;};union{ long i;int 下列程序的输出结果是( )。#include<stdio.h>main(){ struct st { int y, x,z; }; union { long i; int j; char k; }un; printf("%d,%d\n",sizeof(struct st),sizeof(un));}A.6,2B.6,4C.8,4D.8,6

考题 有以下程序:includevoid fun(int* s,int* * d){* *d=*(s+2);}main(){ inta[]={1,2,3, 有以下程序: #include <stdlib.h> void fun(int * s,int * * d) { * *d=*(s+2); } main() { int a[]={1,2,3,4,5},*b; b=(int *)malloc(sizeof(int)); fun(a,B) ; printf("%d\n",*b+1); } 程序的输出结果是( )A.2B.3C.4D.5

考题 以下程序的输出结果是( )。 include void swap(int*a,int*B){int*t; t=a;a=b;b=c;} main 以下程序的输出结果是( )。 include<stdio.h> void swap(int*a,int*B){int*t; t=a;a=b;b=c;} main() {int i=3,j=5,*p=i,*q=j; swap(p,q);printf("%d %d\n",*p,*q); }