当前位置:网站首页>[Yu Yue education] C language programming reference of Zhongbei College of Nanjing Normal University

[Yu Yue education] C language programming reference of Zhongbei College of Nanjing Normal University

2022-07-07 08:34:00 yuyueshool

education
-C Language programming - Chapter materials, examination materials - Zhongbei College of Nanjing Normal University 【】
Chapter one unit testing
1、【 Single topic selection 】 For computers , The last thing to do C Language program is ( )
A、 Source program
B、 Target program
C、 assembler
D、 Executable program
Reference material 【 】
2、【 Single topic selection 】 What is true in the following statement is ( )
A、C The basic unit of a program is a statement
B、C Only one statement can be written on each line of the program
C、C Statement must end with semicolon
D、C The language must be written in one line
Reference material 【 】
3、【 Single topic selection 】 The following statement is wrong ( )
A、 One C The program can contain multiple functions with different names
B、 One C A program can only have one main function
C、C When the program is written , There are strict indentation requirements , Otherwise, it cannot be compiled
D、C The main function of the program must use main As function name
Reference material 【 】
4、【 Single topic selection 】 About the notes, the following statement is correct ( )
A、 The contents of the notes must be put in a pile / and / Between , or // after
B、 Comments must be placed before or after the stated statement
C、 Another comment can be nested in the middle of the comment
D、 Incorrect annotation content will lead to compilation errors
Reference material 【 】
5、【 Single topic selection 】C After the language program is written , The sequence of operations that should be performed is ()
A、 perform - compile - Connect
B、 compile - Connect - perform
C、 Connect - perform - compile
D、 Connect - compile - perform
Reference material 【 】
6、【 Single topic selection 】 About main Function , The right is ()
A、 The program always starts from main() Function entry
B、 if main There are no parameters after the function , Then the back pair () Can don't
C、main() As the first part of the function , There should be a semicolon at the back ;
D、main() The function body of the function uses () Cover up
Reference material 【 】
7、【 Single topic selection 】 For sentences int a,b; It's wrong to say
A、 It's a variable. a Defined as an integer ,b yes void type
B、 Is the definition statement ,a,b Value in but not available
C、 The purpose of this statement is to allocate the corresponding space for variables in memory
D、 You can assign values to variables directly while defining statements
Reference material 【 】
8、【 Single topic selection 】 For output sum Value , The correct way to write it is ()
A、printf(“sum is”,sum);
B、printf(“sum is %d”,&sum);
C、printf(“sum is %d”,sum);
D、scanf(“sum is”,sum);
Reference material 【 】
9、【 Multiple choice 】 about #includestdio.h This statement is correct
A、 This is a compilation preprocessing statement
B、stdio.h Is a file name provided by the system , This file stores some function declarations and variable definitions
C、 Without this statement , All functions cannot be executed
D、C When compiling, the preprocessor processes the preprocessing instructions first
Reference material 【 】
10、【 Multiple choice 】 A program mainly includes ()
A、 Variable
B、 Algorithm
C、 loop
D、 data structure
Reference material 【 】
11、【 Multiple choice 】 The characteristics of the algorithm are ()
A、 Fineness
B、 deterministic
C、 There are multiple outputs
D、 effectiveness
Reference material 【 】
12、【 Multiple choice 】 The three basic structures in the program are ()
A、 Sequential structure
B、 Loop structure
C、 Jump structure
D、 Selection structure
Reference material 【 】
13、【 Multiple choice 】 The following can be used to compile C The language environment has
A、VC++6.0
B、DEVC++
C、Excel
D、CodeBlocks
Reference material 【 】
14、【 Multiple choice 】 When used scanf(%d%d%d,a,b,c); Statement when entering a value , It can be used () Symbols are entered as spacers .
A、 Space
B、 Slash /
C、 enter
D、tab
Reference material 【 】
15、【 Judgment questions 】 If the program compiles without error, it will be successful
A、 correct
B、 error
Reference material 【 】
16、【 Judgment questions 】 sentence “a=3;” Variable means variable a And 3 equal
A、 correct
B、 error
Reference material 【 】
17、【 Completion 】 The output of the following program is _________#include stdio.hint main(){ int a=0,b=0; b=20; printf(a+b=%d,a+b); return 0;}
A、
Reference material 【 】
Chapter two unit testing
1、【 Single topic selection 】 The legal user identifier in the following items is
A、st.1
B、 char
C、 1as
D、 INT
Reference material 【 】
2、【 Single topic selection 】 If there is a definition inta,b,c; The assignment statement in the following options is correct
A、a=(b=c)+ 1;
B、 (a=b)=c= 1;
C、a=(b=c)= 1;
D、 a+b=c;
Reference material 【 】
3、【 Single topic selection 】 Let the variable be correctly defined and assigned , The correct expression below is
A、x=y+z+5, ++y
B、int(15.8%5)
C、x=y5=x+ z
D、x=25%5.0
Reference material 【 】
4、【 Single topic selection 】 If there is a definition : char c; int d; , Program run time input : 1,2 enter , Can put the value 1 Input to variable c、 value 2 Input to variable d The input statement for is
A、scanf"%c,%d", &c,&d);
B、scanf("%c%d", &c,&d);
C、scaf("%d,%f", &c,&d);
D、canf("%d%d", &c,&d);
Reference material 【 】
5、【 Single topic selection 】 With definition : int x=7,y=12;, Then the following expression value is 3 Yes.
A、 y%=(x-x%5)
B、y%=(x%=5)
C、y%=x-x%5
D、(y%=x)-(x%=5)
Reference material 【 】
6、【 Single topic selection 】 If you want to have defined as int Type variables a、b、C、d Assignment integer 2, The wrong statement in the following options is
A、d=c,c=b, b=a, a=2;
B、d=c=b=a=2;
C、d=(b=c=(a=2));
D、d=2,c=d, b=c, a=b;
Reference material 【 】
7、【 Single topic selection 】 The following is legal C The language assignment statement is
A、a=10
B、x=y=10;
C、 i++
D、m=2,n=5
Reference material 【 】
8、【 Single topic selection 】 There are the following sections int m=3, n=4, x;x=-m++;x=x+8/++n;printf(x=%d\n,x);
A、x=3
B、x=5
C、x=-1
D、x=-2
Reference material 【 】
9、【 Single topic selection 】 The output of the following block is int a=2, b=3, c=4;a
=16+(b++)-(++c);printf(%d\n,a);
A、28
B、30
C、26
D、32
Reference material 【 】
10、【 Single topic selection 】 stay C In language , The operator that requires that the number participating in the operation must be an integer is
A、/
B、*
C、%
D、=
Reference material 【 】
The third chapter unit testing
1、【 Single topic selection 】 With definition “int a; float b;”, perform scanf(“%2d%f”,a,b); When the sentence is , If you input from the keyboard 876 Space 854.0 enter ,a and b The values of are ( ).
A、876 and 543.000000
B、87 and 6.000000
C、87 and 543.000000
D、76 and 543.000000
Reference material 【 】
2、【 Single topic selection 】 The output of the following program is ( ) main() { int m=2, n=3; printf(m=%d%d,n=%%d,m,n);}
A、m=2, n=3
B、m=%2, n=%3
C、m=%%d,n=%%d
D、m=23, n=%d
Reference material 【 】
3、【 Single topic selection 】 If there is a definition int a,b; , Pass statement “scanf(%d;%d,a, b); , Can put integers 3 Assigned to a variable a,5 Assigned to a variable b The input data for is
A、3 5
B、3,5
C、3;5
D、35
Reference material 【 】
4、【 Single topic selection 】 When executing the following program segments, the output result is ( )int x=13,y=5; printf(“%d”,x%=(y/=2));
A、3
B、2
C、1
D、0
Reference material 【 】
5、【 Single topic selection 】 When executing the following program segments, the output result is ( ) int x=5,y; y=2+(x+=x++,x+8,++x); printf(“%d”,y);
A、13
B、14
C、15
D、16
Reference material 【 】
6、【 Single topic selection 】 Write the output of the following program ( ) main ( ) { int x=12; printf(“%6d##,%-6d##\n”,x,x); }
A、12
B、
C、,12
D、
E、
F、 12
G、
H、, 12
I、
J、
K、12
L、
M、,12
N、
O、
P、 12
Q、
R、,12
S、
T、
Reference material 【 】
7、【 Completion 】 The output of the following program is 16.00, Please fill in (1) Empty makes the program complete int main(){ int a=9,b=2; float x=【1】, y=1.1 , z; z=a/2+bx/y+1/2; printf(%5.2f\n,z); return 0; }
A、
Reference material 【 】
Chapter four unit testing
1、【 Single topic selection 】 if x by int Type variable ,ch by char Type variable , Then the running result of the following program segment is
int x=12, char ch=‘a’;
printf(%x, %o, ch, ch, x);
printf(x=%%d\n, x);
A、 The type defined by the dependent variable does not match the type of the format controller , Output variable value
B、 The number of output variables is different from the number of format controllers , The output is zero or an indefinite value
C、61,141, x=%d
D、61,141, x=%12
Reference material 【 】
2、【 Single topic selection 】 There are known statements long x, y; , And x The decimal representation of an integer in n Digit number (4n10), If it is required to remove integer x The highest bit in the decimal representation , Use the remaining numbers to form a new integer and save it to y in , Then the following expression can correctly realize this function is
A、y=x/(10
(n-1))
B、y=x%(10*(n-1))
C、y=x%(long)pow(10, n-1)
D、y=x%(10^(n-1))
Reference material 【 】
3、【 Single topic selection 】 The following is wrong if The sentence form is ( )
A、if(xy) x+=y;
B、if(x>y);
C、if(x!=y) {x++;y++;}
D、if(x>=y) x++ else y++;
Reference material 【 】
4、【 Single topic selection 】 There are preprocessing commands #includemath.h And the statement int x=4, y; , The correct syntax in the following statement is
A、if (x%2=1) y=x;
B、if (sqrt(x) %2) y=x;
C、if (x
1) y=x;
D、if (x1) y=&x;
Reference material 【 】
5、【 Single topic selection 】 It has been declared that “ int x=15, y; float z=12; ”, The correct syntax in the following expression is
A、x=y=z*2
B、z>0?y=x;y=-x
C、y=x%3.5
D、x+2=z-3
Reference material 【 】
6、【 Single topic selection 】 The following represents the mathematical formula “ xyz” In the logical expression of , The wrong is
A、x<y<z
B、x<y&&y<z
C、!(x>=y) && !(y>=z)
D、!(x>=y||y>=z)
Reference material 【 】
7、【 Single topic selection 】 There is a definition “ int x=12,y=15,z; , Then execute the expression ”z=(x || (y-=x) )“ after , Variable y and z The values of are
A、3,1
B、15,12
C、15,1
D、3,12
Reference material 【 】
8、【 Single topic selection 】 Given conditional expression (m)?(a++):(a–), Then the expression m and _______ Equivalent ?
A、(m!=0)
B、(m!=1)
C、(m= =0)
D、(m= =1)
Reference material 【 】
9、【 Completion 】 set up x、y、t Are all int Type variable , Then execute the statement : x=y=3; t=++x||++y; after ,
x The value of is [ Fill in the blanks 1] , y The value of is [ Fill in the blanks 2]( Output two values , Separate... With spaces )
A、
Reference material 【 】
10、【 Completion 】 Definition int x=8,y,z;
perform y=z=x++;x=y
z; after x The value of is _________
A、
Reference material 【 】
11、【 Completion 】 The output of the following program is _______
main()
{ int x=100, a=10,
b=20, ok1=5, ok2=0;
if(ab) if(b!=15) if(! ok1) x=1;
else if(ok2)x=10;
else x=-1;
else x=2;
printf(%d\n,x);
}
A、
Reference material 【 】
12、【 Completion 】 If you input from the keyboard 58, Then the output of the following program is __
main()
{ int a;
scanf(%d,a);
if(a50) printf(%d,a);
if(a40) printf(%d,a);
if(a30) printf(%d,a);
}
A、
Reference material 【 】
13、【 Completion 】 The running result of the following program is _______
main()
{ int x=3,y=0,z=0;
if(x=y+z) printf(“****”);
else printf(“####”);
}
A、
Reference material 【 】
14、【 Completion 】 set up int a=9,b=8,c=7,x=1; Then execute the statement
if(a7)if(b8)if(c9)x=2;
else x=3;
after x= _______
A、
Reference material 【 】
testing while Grasp of sentences
1、【 Completion 】1、 The output of the following program is _______main()
{ int k=4;

while(k–);

printf(k=%d\n,k);
}
A、
Reference material 【 】
2、【 Completion 】2、 The output of the following program is _______main()

{ int k=10;

while(k=0) k=k-1

printf(k=%d\n,k);

}
A、
Reference material 【 】
testing do-while Grasp of sentences
1、【 Single topic selection 】1、 The loop body of the following program segment is executed several times ?int x=-1;do { x=x*x;}while(!x);A) 0 Time B) 1 Time C)2 Time D)3 Time
A、0 Time
B、1 Time
C、2 Time
D、3 Time
Reference material 【 】
2、【 Completion 】2、 The output of the following program is _________.main(){ int a=1,b=10; do { b-=a; a++; }while(b–0);printf(a=%d,b=%d,a,b);}
A、
Reference material 【 】
3、【 Completion 】3、 The output of the following program is _________.main(){ int x=3; do { printf(%d\n,x-=2); }while(!(–x));}
A、
Reference material 【 】
test for Grasp of sentences
1、【 Single topic selection 】 if i For integer variables , Then the number of execution cycles of the following program segments is ________for(i=2;i==0;)
printf(%d\n,–i);
A、0 Time
B、1 Time
C、2 Time
D、3 Time
Reference material 【 】
2、【 Single topic selection 】 Yes for( expression 1;; expression 3) Can be understood as
A、for( expression 1;0; expression 3)
B、 for( expression 1;1; expression 3)
C、for( expression 1; expression 1; expression 3)
D、for( expression 1; expression 3; expression 3)
Reference material 【 】

原网站

版权声明
本文为[yuyueshool]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130638133010.html