以下四项中,符合C语言语法的语句是()
第1题:
以下程序的输出结果是
#include <stdio.h>
void prt (int *x, int*y, int*z)
{printf("%d,%d,%d\n",++*x,++*y,*(z++));}
main()
{int a=10,b=40,c=20;
prt (&a,&b,&c);prt (&a,&b,&c);}
A.11,42, 31 12,22,41
B.11,41,20 12,42,20
C.11,21,40 11,21,21
D.11,41,21 12,42,22
第2题:
下面程序的运行结果是
#include
void fun(int*a,int* b)
{
int x=*a
*a=,b;*b=x;
cout<<*a<<*b<<” ”;
}
void main()
{
int x=1,y=2;
fun(&x,&y);
cout<<<
}
A.12 12
B.12 21
C.21 12
D.21 21
第3题:
以下程序的输出结果是 #include<stdio.h> void prt(int *x,int*y,int*z) { printf("%d,%d,%d\n",++*x,++*y,*(z++));} main() { int a=10,b=40,c=20; prt(&a,&b,&c); prt(&a,&b,&c);}
A.11,42,31 12,22,41
B.11,41,20 12,42,20
C.11,21,40 11,21,21
D.11,41,21. 12,42,22
第4题:
以下程序的输出结果是( )。 #include<stdio.h> void prt(int *x,int *y,int *z) { printf("%d,%d,%d\n",++ *x,++ *y,*(z++));} main() { int a=10,b=40,c=20; prt(&a,&b,&c); prt(&a,&b,&c); }
A.11,42,31 12,22,41
B.11,41,20 12,42,20
C.11,21,40 11,21,21
D.11,41,21 12,42,22
第5题:
A.int a+b=c
B.int a=12:b=12:c=12
C.int a=12,b=12,c=12
D.int a,b=12,float c=21
第6题:
下面程序的运行结果是( )。 #include<iostream.h> void fun(int *a,int *B. { int x=*a: *a=*b;*b=X; cout<<*a<<*b<<””: void main { int X=1,Y=2; fun(&x,&y); cout<<x<<Y<<endl; }
A.12 12
B.12 21
C.21 12
D.21 21
第7题:
下面程序的运行结果是 #include<iostream,h> void fun(int*a,int*b) { int X= *a; * a= *b; *b=X; cout<< *a<< *b<<" "; void main() int x=1, y=2; fun(&x,&y); cout<<X<<y<<end1; }
A.12 12
B.12 21
C.21 12
D.21 11
第8题:
A.char c="/n";
B.int i=12;
C.float f=2.8;
D.boolean b=null;
第9题:
1. interface DoStuff2 { 2. float getRange(int low, int high); } 3. 4. interface DoMore { 5. float getAvg(int a, int b, int c); } 6. 7. abstract class DoAbstract implements DoStuff2, DoMore { } 8. 9. class DoStuff implements DoStuff2 { 10. public float getRange(int x, int y) { return 3.14f; } } 11. 12. interface DoAll extends DoMore { 13. float getAvg(int a, int b, int c, int d); } What is the result?()
第10题:
下面关于变量定义且赋值语句正确的是()
第11题:
对于变量的初始化,以下几种方法中错误的是()
第12题:
n=12%3.0;(n为int型)
12/3.0
12/3
‘a’>’b’
第13题:
下面程序的运行结果是
#include<iostream.h>
void fun(int * a,int * b)
{
int x= * a;
* a= * b; * b=X;
cout < < * a < < * b < <" ";
}
void main( )
{
int x=1,y=2;
fun(&x,&y) ;
cout < < X < < y < < endl;
}
A.12 12
B.12 21
C.21 12
D.21 21
第14题:
下列哪个赋值语句是正确的?
A.char a=12;
B.int a=12.0;
C.int a=12.0f;
D.int a= (int)12.0;
第15题:
以下C程序段的输出结果是(30)。 #include<stdio.h> void prt(int*x,Int*y,int*z){ printf("%d,%d,%d\n",++*x,++*y,*(z++)); } void main(){ int a=10,b=40,c=20; Prt(&a,&b,&c); Prt(&a,&b,&c); }
A.11,42,31 12,22,41
B.11,41,20 12,42,20
C.11,21,40 11,21,41
D.11,41,20 12,42,22
第16题:
请使用VC6或使用【答题】菜单打开考生文件夹projl下的工程projl。程序中位于每个“//ERROR****found料****之后的一行语句有错误,请加以改正。改正后程序的输出结果应为: Name:Smith Age:21 ID:99999 CourseNum:12 Record:970 注意:只修改每个“//ERROR****found****”下的那一行,不要改动程序中的其他内容。 include<iostream> using namespace std; class Studentlnfo { protected: //ERROR********************found**************** char Name; int Age; int ID: int CourseNum; float Record; public: Studentlnfo(char*name,int Age,int ID,int coumeNum,float record); //ERROR ********************found******************** void~Studentlnfo{} float AverageRecord{ return Record/CourseNum; } void showconst{ cout<<”Name:”<<Name<<”Age:”<<Age<<”ID:”<<ID <<”CourseNum:”<<CourseNum<<”Record:”<<Record<<endl; } }; //ERROR ******************found************** StudentInfo StudentInfo(char*Name,int Age,int ID,int CourseNum,float Record) { Name=name; Age=age; this一>ID=ID: CourseNum=courseNum: Record=record; } int main { Studentlnfo st(’’Smith”,21,99999,12,970); st.show; return 0; }
(1)char*Name;
(2)~Studentlnfo{}
(3)Studentlnf0::Studentlnfo(char*name,int age,,int ID,int eourseNum,float record)
第17题:
以下程序的输出结果是( )。 #include<stdio.h> void prt(int *x,int *y,int *z) {printf("%d,%d,%d\n",++*x,++*y,*(z++));} main() {inta=10,b=40,c=20; prt(&a,&b,&C); prt(&a,&b,&C);}
A.11,42,31 12,22,41
B.11,41,20 1,42,20
C.11,21,40 11,21,21
D.11,41,21 12,42,22
第18题:
下列的哪个赋值语句是正确的?
A.char a=12;
B.int a=12.0;
C.int a=12.0f;
D.int a=(int)12.0;
第19题:
以下程序的输出结果是______。 #include<stdio.h> void prt(int.*x,int*y,int*z) { printf("%d,%d,%d\n",++*x,++*y,*(z++));} int a=10,b=40,c=20; main() { prt(&a,&b&c) ; prt(&a,&b,&c) ; }
A.11,42,31 12,22,41
B.11,41,20 12,42,20
C.11,21,40 11,21,41
D.11,41,21 12,42,22
第20题:
执行下面的语句后,a、b、c的值分别是() int a=2; int b=(a++)*3; int c=(++a)*3;
第21题:
下面哪条语句定义了5个元素的数组()。
第22题:
下列表达式或语句中,有语法错误的是()
第23题:
int a+b=c
int a=12:b=12:c=12
int a=12,b=12,c=12
int a,b=12,float c=21