September 2004 C test paper and answer (taken from carefree

xiaoxiao2021-03-06  124

September 2004 C test paper and answer (from worry-free test network) [original] September 200, 2004, second-level C test, entry correction and correct answer version 1. Select question 1, the number of hexadecimal numbers with the decimal number 200 As (c) a) A8 b) A4 C) C8 D) C42, the tissue structure of (D) a) Star Structure B) Net Structure C) Ring Structure D) Tree Structure 3, for the memory According to bytes, if a memory chip has a total of 10 address lines, the storage capacity of the memory chip is (a) 1kb b) 2kb c) 4KB D) 8kb4, in the DOS environment, represents the keyboard and display The device file name is (b) a) PRN b) CON C) NUL D) LPT5, the main feature of the computer network is (c) a) Computational speed fast b) Computing precision High C) Resource Sharing D) Human Machine Interaction 6 The data (b) a) of the disk is in a write protection state cannot be read, can not be deleted B) can read, can not be deleted C) Cannot read, can be deleted, can be read, can be deleted 7, from the Windows environment After entering the MS-DOS mode, return the DOS command of the Windows environment to (a) a) EXIT B) QUT C) RET D) MSDOS8, in the Windows environment, if the resource manager's left window is labeled "" "Tag, indicating (b) a) This folder is empty b) This folder contains subfolder C) This folder contains only executable file D) The folder contains system files 9, In the Windows menu, the dimming command name Item indicates that the command (a) a) is temporarily unable to use B) in execution C) containing the next layer menu D) contains the dialog 10, in the Windows environment, click the button in the current window "", Its function is (c) a) turn the current application to the background Run B) After exiting Windows, then shut down C) Termination of the current application running D) Restart the computer after exiting Windows 11. Code written in C language Program BA) can be executed immediately B) is a source program c) During compilation, it is executed to execute 12. The structured program consists of three basic structures, and the algorithm of three basic structures CA) can complete any Complex task b) You can only complete part of complex task c) can only complete the structured task D) can only complete some simple tasks 13. The following definition statement is correct 13. The following definition statement is correct in CA CHAR A = 'a'b =' b '; b) float a = b = 10.0; c) int a = 10, * b = & a ; D) float * a, b = & a; 14. In the following options, the identifier is not used as the identifier is DA) _1234_ b) _1_2 c) INT_2_D) 2_INT_15. There is the following definition statements Double A, B; int W; long C; If the variables have been correctly assigned, the correct expression in the following options is CA) a = a b = b b) w% (int) a b) c) (c w)% (int) a D) w = a == b; 16. There is the following program main () {int m = 3, n = 4, x; x = -m ; x = x 8 / n; printf ("% D / N ", x);} The output result after the program is DA) 3 b) 5 c) -1 d) -2 17. There is the following program main () {char a = 'a', b; print ("%) C, ", A); Printf ("% c / n ", b = a );} The output of the program is AA) B, B) B, C C) A, B D) A, C 18. The following procedure main () {Int m = 0256, n = 256; Printf ("% O / N", Mn, N);

} The output result after the program is CA) 0256 0400 b) 0256 256 C) 256 400 D) 400 400 19. The following procedure main () {Int a = 666, b = 888; Printf ("% D / N" , A, b);} The output result after the program is BA) error message b) 666 c) 888 D) 666, 888 20. There is the following program main () {INT I; for (i = 0; i <3; i ) Switch (i) {case 0: Printf ("% d", i); case 2: printf ("% d", i); default: printf ("% d", i);}}} The output is CA) 022111 B) 021021 C) 000122 D) 012 21. If X and Y are constant, the following expressions cannot be correctly represented by mathematical relationships | xy| <10 is CA) ABS (XY) <10 B) xy> -10 && xy <10c) @ (xy) <- 10||! (Yx)> 10 d) (xy) * (xy) <100 22. There is the following program main () {Int a = 3, B = 4, C = 5, D = 2; if (a> b) IF (b> c) Printf ("% D", D 1); Else Printf ("% D", D 1) PRINTF ("% D / N", D);} The output result after the program is AA) 2 b) 3 c) 43 d) 44 23. Different in the following conditional statements Different from other statements DA) IF (a) Printf ("% d / n", x); Else Printf ("% d / n", y); b) IF (a == 0) Printf ("% d / n", y); ELSE printf ( "% d / n", x); author: 61.190.0 * 2004-9-22 23:57 back this statement 2

September 2004 C test paper and answer (from worry-free test network) c) IF (a! = 0) Printf ("% d / n", x); Else Printf ("% d / n", y); D ) IF (a == 0) Printf ("% d / n", x); Else Printf ("% d / n", y); 24. The following program main () {INT i = 0, x = 0 For (;;) {if (i == 3||| == 5) Continue; if (i == 6) Break; i ; s = i;}; printf ("% d / n", s) The output result after the program is DA) 10 b) 13 c) 21 D) The program enters the dead cycle 25. If the variable is correctly defined, the program segment is required to complete the calculation of 5! Ba) for (i = 1, p = 1; i <= 5; i ) p * = i; b) for (i = 1; i <= 5; i ) {p = 1; p * = i;} C) i = 1; p = 1; while (i <= 5) {p * = i; i ;} D) i = 1; p = 1; do {p * = i; i ;} while (i < = 5); 26. There is the following procedure main () {char A, B, C, D; Scanf ("% C,% C,% D,% D", & A, & B, & C, & D); Printf (" C,% C,% C,% C / N ", A, B, C, D);} When running on the keyboard when running: 6, 5, 65, 66 The output result is AA) 6, 5, a, b b) 6, 5, 65, 66 c) 6, 5, 6, 5 d) 6, 5, 6, 6 27) The following can correctly define the two-dimensional array of CAs) INT A [ ] [3]; b) int a [] [3] = 2 {2 * 3}; c) int A [] [3] = {}; d) int a [2] [3] = {1} , {2}, {3, 4}; 28. The following procedure INT f (int A) {RETURN A% 2;} main () {Int S [8] = {1, 3, 5, 2, 4 , 6}, I, d = 0; for (i = 0; f (s [i]); i ) D = S [i]; Printf ("% d / n", d);} After running The output result is AA) 9 b) 11 c) 19 D) 21 29. If there is an explanation and statement, INT C [4] [5], (* P) ​​[5]; p = C; can correctly collect C array Element is DA) P 1 b) * (p 3) c) * (p 1) 3 D) * (p [0] 2]) 30. Some procedures Main () {Int a = 7, b = 8, * p, * q, * r; p = & a; q = & b; r = P ; P = q; q = r; Printf ("% D,% D,% D,% D / N", * p, * q, a, b);} The output result after the program is running is CA) 8, 7, 8, 7, 8 c) 8, 7, 7, 8 d) 7, 8, 8, 7 31.s12 and S2 have been correctly defined and points to two strings, respectively. If required : When S1 is finger than S2 finger string, the statement S is executed, and the following option is correct to DA) IF (S1> S2) S; B) IF (STRCMP (S1, S2)) S; c) IF (STRCMP (S2, S1)> 0) S; D) IF (STRCMP (S1, S2)> 0) S; 32. Setting a definition statement INT X [6] = {2, 4, 6, 8, 5, 7}, * p = x, i;

Requires the value in the X array 6 elements in turn, the statement that cannot be completed is DA) for (i = 0; i <6; i ) Printf ("% 2d", * (p )); b) for ( i = 0; i <6; i ) Printf ("% 2D", * (p i)); c) for (i = 0; i <6; i ) Printf ("% 2d", * p ); D) for (i = 0; i <6; i ) Printf ("% 2d", (* p) ); 33. With the following procedure #include main () {int a [] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,}, * p = a 5, * q = NULL; * Q = * (P 5); Printf ("% D% D / N", * p, *} The output result after the program is AA) After running, error B) 6 6 C) 6 11 D) 5 10 34 has the following definitions and statements INT A [3] [2] = {1, 2, 3, 4, 5, 6,}, * p [3]; P [0] = a [1]; then * p [0] 1) represent The array element is CA) a [0] [1] b) a [1] [0] c) a [1] [1] 35. has the following procedure main () {char Str [] [10] = {"China", "beijing"}, * p = Str; Printf ("% s / n", p 10);} The output result after the program is BA) China b) bejing C NG D) ING 35. There is the following procedure main () {char s [] = "abcd", * p; for (p = s 1; p

September 2004 C test paper and answer (from worry-free test network) c) cyclic calls D) Cyclic calls in C) C language not allowed to call 38. Existing: INT I, A [10], * P , The legal assignment statement is DA) P = 100; b) p = a [5]; c) P = a [2] 2; D) P = a 2; 39. The following narrative is correct AA) Local variable Description is static storage, and its survival will result in an extended B) Global variable Description is a Static storage class, and its scope will be expanded C) Any memory class variable is not assigned, its value is Uncertain D) The storage class specifier can be used with the local variable 40. There is a definition statement: CHAR C1 = 92, C2 = 92;, the following expression is zero aa) C1 ^ C2 b) C1 & C2 C) ~ C2 D) C1|C241. The FUN function is described below in the program. Void * fun (); this explanation is: CA) Fun Number No return value b) The return value of the FUN function can be Is any data type C) return value of the FUN function is a validity pointer type D) pointer FUN points to a function, the function has no return value 42. The following program main () {char s [] "YES / N / NO ", * ps = S; PUTS (PS 4); * (PS 4) = 0; PUTS (S);} The output of the program is (the first line in the option D is a space) BA N / NO B) / NO C) N / NO D) YES YES YES / NO / NO / NO43. There is the following procedure BMAIN () {Unsigned Int A; int b = -1; a = B; printf ("%) u ", a);} The output result after the program is a) -1 b) 65535 c) 32767 D) -3276844. There are the following procedures Void Fun (int * a, int I, int j) {INT T; IF (i Num B) P-> Num C) (* p) .num D) STU [3] .age46. Some procedures Amain () {int x [] = {1, 3, 5, 7, 2, 4, 6, 0}, i, j, k; for (i = 0 i <3; i ) for (j = 2; j> = i; j--) IF (x [j 1]> x [j]) {k = x [j]; x [j] = x [j 1]; x [j 1] = k;} for (i = 0; i <3; i ) for (j = 4; j <7-i; j ) IF (x [j 1] > x [j]) {k = x [j]; x [j] = x [j 1]; x [j 1] = k;} for (i = 0;

I <3; i ) for (j = 4; j <7-i; j ) IF (x [j]> x [j 1]) {k = x [j]; x [j] = x [j 1]; x [j 1] = k;} for (i = 0; i <8; i ) Printf ("% d", x [i]); printf ("/ n");} The result of the output is: a) 75310246 b) 01234567 C) 76310462 D) 1357024647. There is a procedure #include main () {file * fp1; fp1 = fopen ("f1.txt", "w" FPRINTF (FP1, "ABC"); fclose (fp1); ABC D) Abcgood48 ~ 50. The following programs are: establish a one-way lin list with header nodes, and dump the characters stored in an array to each node of the linked list, please from the underscore A set of selected groups in the number selected. 48C 49A 50B # include stuct node {char data; struct node * next;}; (48) creatlist (char * s) {struct node * h, * p, * q); h = (struct node *) malloc (Struct node)); p = q = h; while (* s! = '/ 0') {p = (struct node *) Malloc (Struct Node); P-> Data = (49); Q-> Next = P; Q = (50); S ;} P-> Next = '/ 0'; return h;} main ) {Char str [] = "link list"; struct node * head; head = createlist (str); ...} (48) a) char * b) Struct node c) Struct Node * d) char (49) A) * s B) s C) * s D) (* s) OF: 61.190.0 * 2004-9-. 22 23:57 Reply This speech 4

September 2004 C test paper and answer (from worry-free test network) (50) a) p-> next b) p c) s d) S-> Next 2. Fill blanks 1. In 64 high-grade microcomputer, CPU It can simultaneously handle the binary data of [8] bytes .2.e-mail address consists of two parts: domain name and username, with @ 分 分, in which the part of @ is [Domain Name] 3. Windows window Composed of some part of the title bar, menu bar, control button. For mobile windows, you must use the mouse to drag [Title Bar .4. Computer software is divided into system software and application software, the UNIX system belongs to [System Software] .5. In the Windows environment, in order to store the screen content into the clipboard, press the [Print Screen Sysrq] key. 6. The output result of the following block is [11] int i = 9; Printf ("% o / n", i) ; 7. The output result after the following procedure is [25 21 37]. Main () {Int A, B, C; a = 25; b = 025; c = 0x25; Printf ("% D% D% D / N ", A, B, C);} 8. The output result after the following procedures run is [24] .MAIN () {INT P [7] = {11, 13, 14, 15, 16, 17, 18} ; Int i = 0, j = 0; while (i <7 && p [i]% 2 == 1) j = p [i ]; Printf ("% d / n", j);} 9. The following procedure The output result is [2 1]. Main () {INT x = 1, y = 0, A = 0, b = 0; switch (x) {case 1: switch (y) {case 0: A ; Break; Case 1: B ; Break;} Case 2: A ; B ; Break;} Printf ("% D% D / N", A, B);} 10. The output result after the following procedures is [92] . main () {Int a [4] [4] = {1, 2, 3, 4}, {5, 6, 7, 8}, {11, 12, 13, 14}, {15, 16, 17, 18}}; int i = 0, j = 0, s = 0; while (i <4) {if (i == 2||| == 4) Continue; j = 0; do {s = a [J]; J ;} while (j <4);} P RINTF ("% d / n", s);} 11. The output result after the following procedures run is [GAE] .MAIN () {char A [] = "language", b [] = "prograime"; char * P1, * p2; int K; p1 = a; p2 = b; for (k = 0; k <= 7; k ) IF (* p1 k) == * (p2 k)) Printf ("% C) ", * (p1 k)) _;} 12. The output result after the following procedures run is [1 * 3 * 5 * 7 * 9]. This is one of this is IF (I% 2 == 1) The result is * 2 * 4 * 6 * 8 * main () {char a [] = "123456789", * p; int i = 0; p = a; while (* p) {if (i% 2 == 0 ) * P = '*'; p ; i ;} PUTS (A);

转载请注明原文地址:https://www.9cbs.com/read-99274.html

New Post(0)