首页/ 题库 / [单选题]以下程序的运行结果是( )。 #incl的答案

以下程序的运行结果是( )。 #include <stdio.h> main() { st,uct date {int year,month,day;}today; printf("%d ",sizeof(struct date)); }

单选题
2022-01-09 15:59
A、6
B、8
C、10
D、12
查看答案

正确答案
A

试题解析
解析:结构体变量的长度是其内部成员总长度之和,在本题中,structdate中包含year,month,day三个整型变量。通常一个整型变量占2个字节,因此,用sizeof求得该结构体变量的长度为6个字节。

标签:
感兴趣题目
有以下程序: #include <stdio, h> main( ) { int m =0256,n =256; printf( "% o % o " ,m,n); 程序运行后的输出结果是( ) 。
以下程序的输出结果是( )。 #include<stdio.h> main() { printf("%d ",NULL); }
有以下程序: #include <stdio. h> main( ) { unsigned int a; int b=-1; a=b; printf(" % u", a);程序运行后的输出结果是( )。
有以下程序: #include <stdio.h> main() {int y=9; for( ; y>0; y--) if(y%3==0) printf("%d", --y); } 程序的运行结果是( )。
有以下程序: #include <stdio.h> main( ) { char s[ ] ="159" , * p; p=s; printf( "% c", * p + + ); printf("%~", * p++);}程序运行后的输出结果是( )。
有以下程序: #include<stdio.h> main( ) {int X=011; printf("%d ",++x); } 程序运行后的输出结果是( )。
有以下程序: #include <stdio.h> main() { int x=3,y=2,z=1; printf("%d ",x/y&~z); 程序运行后的输出结果是( )。
有以下程序 #include <stdio.h> main0 { int y=9; for( ;y>0;y--) if(y%3==0) printf("%d",--y); } 程序的运行结果是
有以下程序: #include <stdio.h> #include <string.h> main() { char str[][20]={"Hello","Beijing"},*P=str[0]; printf("%d ",strlen(p+20)); } 程序运行后的输出结果是( )。
有以下程序: #include<stdio.h> #define X 5+6 main() {int a=2,c; C=X*2: printf("%d",C); } 程序运行后的输出结果是( )。
有以下程序: #include<stdio.h> main() { int y=9; for(;y>0;y--) f(y%3==0)printf("%d",--y); } 程序的运行结果是( )。
以下程序: #include<stdio.h> #include<string.h> main() {char str[]="abcd 123xab"; printf("%d",(str)); } 运行后的输出结果是( )。
相关题目
有以下程序: #include < stdio. h > main( ) { ehar str[ ] [10] = { "China" ," Beijing" } , * p = str[o]; printf( "% s ", p + 10); }程序运行后的输出结果是( )。
以下程序的运行结果是 ( ) #definePI 3.141593 #include<stdio.h> main( ) { printf("PI=%fn",PI); }
有以下程序: #include<stdio.h> main() { printf("%d ",NULL);} 程序运行后的输出结果是( )。
有以下程序: #include <stdio.h> main() { printf("%d ",NULL)"} 程序运行后的输出结果是( )。
有以下程序#include <stdio.h>main( ){ printf("%d\n",NULL); }程序运行后的输出结果是
有以下程序: #include<stdio.h> main() {printf("%d ",NULL)); 程序运行后的输出结果是( )。
以下程序的运行结果是( )。 #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 main(){ int x=011; printf(%d,++x);}程序运行后的输出结果是(  )。
有以下程序(其中k的初值为八进制数):#include main(){ int k=011; printf(%d,k++);}程序运行后的输出结果是(  )。
有以下程序:#include main(){ char s[10] = verygood, *ps = s; ps += 4; ps = nice; puts(s);}程序的运行结果是(  )。
有以下程序:#include #include main(){ char a[20]=ab,b[20]=cdef; int k=0; strcat(a,b); while(a[k]!='\0') {  b[k]=a[k];  k++; } puts(b);}程序的运行结果是(  )。
有以下程序: #include <stdio.h> main( ) { chars[] ="Yes /No",*ps=s; puts(ps +4); * (pa +4) =0; puts(s); }程序运行后的输出结果是( )。
有以下函数:#include main(){ int a=12,c; c=(a<<2)<<1; printf(%d,c);}程序运行后的输出结果是(  )。
有以下程序:#include main(){ int a=3; int b=3; printf(%d, a&b);}程序运行后的输出结果是(  )。
有以下程序:#include int fun(int a,int b){ if(b==0)return a; else return(fun(--a,--b));}main(){ printf(%d,fun(4,2));}程序运行的结果是(  )。
有以下程序#include main(){ int i=1; i=i^i; printf(%d,i);}程序运行后的输出结果是(  )。
有以下程序:#include #include #include main(){ char*p1,*p2; p1=p2=(char*)malloc(sizeof(char)*10); strcpy(p1,malloc); strcpy(p2,p1+1); printf(%c%c, p1[0], p2[0]);}程序的运行结果是(  )。
以下程序的运行结果是 ( ) # include<stdio.h> main( ) { int a=015,b=22; printf("%d,%d ",a+ +,- -b); }
有以下程序: #include <stdio.h> main( ) { int a=7; while(a--); print[("%d ",a); } 程序运行后的输出结果是( )。
广告位招租WX:84302438

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