单选题设定义下列结构体,结构体变量p的出生年份赋值正确的语句是( )。
Struct st
{ int x;
inty;
int z;
}
Struct worker
{ char name[20];
char sex;
struct st birth;
}p;
单选题有下列函数定义: fun(float h) printf("%f,%f/n”,h,h*h); 该函数的类型是( )。 A) int类型 B) float类型 C) void类型 D) 函数无类型说明,定义有错
单选题若有定义:double x=1.5;int a=1,b=3,c=2;则关于C语言中的switch语句,下列选项中正确的是( )。
单选题以下选项中,不能正确赋值的是______。
A. char s1[10]; s1="chest";
B. char s2[]={'C','t','e','s','t'};
C. char s3[20]="Chest";
D. char*s4="Ctest/n"
单选题设有条件表达式:(EXP)?i++;j-,则以下表达式中(EXP)完全等价的是______。
单选题有以下程序:#include <stdio.h>#define P 3void F(int x) return(P* x* x); tmain( ) printf(" % d /n" ,F(3 + 5) ); 程序运行后的输出结果是( )。
单选题有以下程序 main( ) { char a,b,c,d; scanf("%c,%c,%d,%d", printf("c,%c,%c,%c/n",a,b,c,d); } 若运行时从键盘上输入:6,5,65,66。则输出结果是A)6,5,A,BB)6,5,65,66C)6,5,6,5D)6,5,6,6
单选题有以下程序:
#include <stdio.h>
main( )
{int a[]={2,4,6,8,10},x, *p,y=1;
P=
for(x=0; x<3; x++) y+=*(p+x);
printf("%d/n",y);
}
程序的输出结果是______。
单选题设变量a、b、c、d和y都已正确定义并赋值。若有下列if语句if(a<B)if(c==D)y=0;elsey=1;该语句所表示的含义是()。
单选题有以下程序:
#include
#include
typedef strtut{char name[9];char sex;float score[2];}STU;
STU fun(STU a)
{STU b={''Tom'','m',85,90};
int i;
strcpy(a.name,b.name);
a.sex=b.sex:
for(i=0;i<2;i++)a.score[i]=b.score[i];
return a;
}
main()
{STU c={''Alex'','f',95,92},d;
d=fun(c);
printf(''%s,%c,%d,%d,'',d.name,d.sex,d.score[0],d.score[1]);
printf(''%s,%c,%d,%d\n'',c.name,c.sex,c.score[0],c.score[1]);
}
程序运行后的输出结果是( )。
单选题若有下面的说明和定义: struct test int m1; char m2; float m3; union uu char ul[5]; int u2[2]; ua; myaa;则sizeof(struct test)的值是( )。
单选题有如下程序: #include <stdio.h>
main() { char ch='M';
while(ch !='K') {
ch--;
putchar(ch); }
printf("/n"); } 程序运行后的输出结果是______。
A.MN
B.LK
C.OP
D.MM
单选题以下叙述中正确的是______。
单选题若变量a,b已正确定义,且b已正确赋值,则合法的语句是( )。 A) b=double(b); B) ++b; C) a=a++=5; D) a=double(b);
单选题已知有函数f的定义如下:
int f(int a,int b)
{if(a<b);else retum(b,a);}
在main函数中若调用函数f(2,3),得到的返回值是______。
单选题以下叙述中正确的是
单选题sizeof(float)是{{U}} {{/U}}。
A. 一个双精度型表达式
B. 一个整型表达式
C. 一种函数调用
D. 一个不合法的表达式
单选题要求以下程序的功能是计算main()intn;floats;s=1.0;for(n=10;n>1;n--)s=s+1/n;pfintf("%6.4f/n",s);程序运行后输出结果错误,导致错误结果的程序行是
单选题设有以下定义: typedef union {long i;int
k[5];char c,}DATE, struct date {int cat;DATE
cow;double dog;}too; DATE max; 则下列语句的执行结果是
{{U}} {{/U}} printf("%d",stzeof(struct
date)+sizeof(max));
A. 25
B. 30
C. 18
D. 8
单选题有以下程序
#include <stdio.h>
main()
{ int x=1,y=2,z=3;
if(x>y)
if(y<z) printf("%d",++z);
else printf("%d",++y);
printf("%d/n",x++);
}
程序的运行结果是______。