下列语句段中,正确的是( )。
A.street { int x; float y; int a[2]; unsigned b[3]; char name[ 10]; };
B.struct stu { unsigned a[3]; unsigned b[4]; }x; int *p=& x.a;
C.stmct stu { int a; float x[4]; }y={1,1.0}; float data=y.x;
D.struct nd { int a,b; unsigned c[2]=5; };
第1题:
下列定义变量的语句中正确的是( )。A)int _int; B)double 3int_;C)char for; D)float US&;
第2题:
下列语句段中,正确的是( )。
A.struct{int x;float y;int a[2];unsigned b[3];char name[10];};
B.struct stu{unsigned a[3];unsigned b[4];}x;int*p=&x.a;
C.struct stu{int a;float x[4];}y={1,1.0};float data=y.x;
D.struct nd{int a,b;unsigned c[2]=5;};
第3题:
已知语句int m=10;则下列引用的表示中正确的是
A.int &x=m;
B.int &y=10;
C.int &z;
D.float &t=&m;
第4题:
#include
struct Worker{
char name[15] ; //姓名
int age; //年龄
float pay; //工资
};
void main(){
Workerx ={“wangfong",46,2650};
Worker y,*p;
y=x;p=&x;
cout< } 输出结果:
第5题:
执行下列程序段,结果是 #include<iostream.h> void main( ) { int x=40; char y='C'; int n; ? n=(x&0) xff) &&(y>'B') ; cout < < n;}
A.0
B.1
C.2
D.3
第6题:
若定义下列结构体,结构体变量p的出生年份赋值正确的语句是( )。 struct st { int x; int y; int z; } struct worker { char name[20]; char sex; struct st birth; }p;
A.x=1987
B.birth.x=1987;
C.p.birth.x=1987;
D.p.x=1987;
第7题:
有以下定义和语句,则sizeof(a.share)的值是( )。
struct date
{ unsigned int day;
unsigned int mouth;
unsigned int year;
union{int share1;
float share2;
}share;
}a;
第8题:
下列语句段中,正确的是( )。
A.struct {int x; float y; int a[2]; unsigned b[3]; char name[10]; };
B.structstu { unsigneda[3]; unsigned b[4]; }x; int*p=&x.a;
C.struc tsu { int a; float x[4]; }y={1,1.0}; floatdat a=y.x;
D.stmct nd {int a,b; unsigned c[2]=5; };
第9题:
下面程序输出的结果是( )。 #include<iostream> using namespace std; int test(int n1,int n2) {return n1 +n2;} float test (int f1,float f2){return f1-f2;} float test(float x,float y){return(x+y)/2;} float test(float x,int y){return(x+y)*2;} void main(){ int a1=10; float a2=2.5f; cout<<test(a1,a2); }
A.12.5
B.7.5
C.6.25
D.25
第10题:
有以下程序段
int j; float y; char name[50];
scanf(“%2d%f%s”,&j,&y,name);
当执行上述程序段是,从键盘输入55566 7777abc后,y的值为( )。
A.55566.0
B.566.0
C.7777.0
D.566777.0
第11题:
以下C语言语句中,正确的是()
第12题:
int BC(int x, int y);
void BC(int a, char b);
float AA(int a, char b);
int BC(int a, int b=0);
第13题:
已经语句int m=10;则下列表示引用的表示中正确的是( )。
A.int &x=m;
B.int &y=10;
C.int &z;
D.float &t=8m;
第14题:
若各选项中所用变量已正确定义,fun()函数中通过return语句返回一个函数值,下列选项中错误的程序是( )。
A.main() {……x=fun(2,10);……} float fun(int a,int b){……}
B.float fun(int a,int b){……} main() {……x=fun(i,j);……}
C.float fun(int,int); main() {……x=fun(2,10);……} float fun(int a,int b){……}
D.main() {float fun(int I,intj); ……x=fun(i,j);……} float fun(int a,int b){……}
第15题:
设有下列说明语句: strcut str {int x;float y;char z;}st; 则下列的叙述中不正确的是( )。
A.00001111
B.11111101
C.00000010
D.11000000
第16题:
A. float add(int x, int y) ;
B. int add(int x;int y) ;
C. char add( x,y) ;
D. int add(char x[ ] [ ]) ;
第17题:
下列表示引用的方法中,( )是正确的。 已知:int m=10:
A.int &x=m;
B.int &y=10;
C.int &Z
D.float &t=&m;
第18题:
switch(c) 语句中c可以是int, long, char, float, unsigned int 类型。( )
第19题:
若各选项中所有变量已正确定义,函数fun中通过return语句返回一个函数值,以下选项中错误的程序是______。
A.mam() {…… x=fun(2,10); ……} fioat fun(int a,int b) { ……}
B.float fun (int a,int b) {……} main() {…… x=fun(i,j); ……}
C.float fun (int int); main() {…… x=fun(2,10); ……} float fun (int a,int b){ ……}
D.main() { float fun (int i, int j); …… x=fun(i,j); ……} float fun (int a,int b){ ……}
第20题:
已经有“语句intm=10;”则下列表示引用的表示中正确的是( )。
A.int&x=m;
B.int&y=10;
C.int&z;
D.float&t=8m;
第21题:
若下列各选项中所有变量已正确定义,函数fun通过return语句返回一个函数值,以下选项中错误的程序是( )。
A.main( ) {...... x = fun(2,10);......} float fun(int a, int b){......}
B.float fun( int a,int b){......} main( ) {......x = fun(i,j);......}
C.float fun(int, int); main( ) {......x=fun(2,10);......} float fun(iht a, int b){......}
D.main( ) { float fun(int i, int j); ...... x = fun(i,j);......} float fun(int a,int b) {......}
第22题:
下面的函数声明中,()是“void BC(int a, int b);”的重载函数
第23题:
在C语言中下列变量定义和赋值错误的是()。