April 1994
I. multiple choice questions (1-30 points per sub-question, 2 points per sub-question between 31-45 and 60 points in total)
The following are four options: a), B), c), and D. Only one option is correct. Correct options should be blacklisted in the corresponding position of the answer board. Answer: No score on the exam.
(1) The binary number 101110 is converted to the equivalent octal number [1 ].
(1) A) 45b) 56C) 67d) 78
(2) The CPU is composed of [2. 【]
(2) A) internal memory and controller B) controller and Receiver
C) internal memory and Memory D) internal memory, controller and memory
(3) DoS is the [3] disk operating system configured for the ibm pc series microcomputer and its compatible computers.
[3] A) multi-user multi-task B) single-user single task c) time-based d) distributed
(4) after starting the MS-DOS operating system, [4] has resident memory.
(4) A) command. com B) diskcopy. com c) format. com d) CCCC. exe
(5) shows the directory structure on the soft disk in drive B.
If the current directory is F2, copy the prog. Bas file under the root directory of drive a to the F3 subdirectory of drive B. The command is [5 ].
[5] A) Copy Prog. Bas B: B) Copy A: Prog. Bas B :\
C) Copy A: \ Prog. Bas B: \ F3 d) Copy A: Prog. Bas B: \ F3 \
(6) In the following four groups of DOS commands, the group with the same meaning is [6 ].
[6] A) copy and diskcopy B) Comp And diskcomp
C) del and RD d) Rename and Ren
(7) [7] is an effective method to prevent viruses from infected with a floppy disk ].
[7] A) do not put the floppy disk together with the toxic floppy disk B) paste the tape on the write protection gap
C) Keep the IDC clean d) Regularly format the floppy disk
(8) The size of the dual-sided high-density 5 inch soft disk is [8 ].
(8) A) 360kb B) 720kb c) 1.2 MB d) 1.44 MB
(9) In FOXBASE, the two variables that can be used are [9 ].
(9) A) memory variables and field variables B) global variables and local variables
C) field variables and simple variables D) memory variables and automatic Variables
(10) The doscommand for creating a new subdirectory is [10 ].
[10] A) create B) RD c) MD d) CD
(11) In C language, if the following variables are of the int type, the output result is [11 ].
Sum = pad = 5; pad = sum ++, pad ++, ++ pad;
Printf ("% d \ n", pad );
[11] A) 7 B) 6 c) 5 d) 4
(12) The output result of the following program is [12 ].
# Include <stdio. h>
Main ()
{Int I = 010, j = 10;
Printf ("% d, % d \ n", ++ I, j --);}
[12] A) B) c) d)
(13) It is known that in ASCII code, the number of the letter A is 65, and the output result of the following program is [13 ].
# Include <stdio. h>
Main ()
{Char C1 = 'A', C2 = 'y ';
Printf ("% d, % d \ n", C1, C2 );}
[13] A) output error message due to invalid output format B) c) A, y d)
(14) The length of the string indicated by pointer S is [14 ].
Char * s = "\" name \ address \ n ";
[14] A) 19 B) 15 c) 18 d) Illegal
(15) The description int (* PTR) [m] is provided. The identifier PTR is [15 ].
[15] A) m pointers to Integer Variables
B) function pointer pointing to M Integer Variables
C) a pointer to a one-dimensional array with M integer Elements
D) A one-dimensional pointer array with M pointer elements. Each element can only point to an integer.
(16) statement while (! E); condition! E is equivalent to [16 ].
[16] A) E = 0 B) e! = 1 c) e! = 0 d )~ E
(17) The output result of the following program is [17 ].
# Include <stdio. h>
Main ()
{Printf ("% d \ n", null );}
[17] A) uncertain (the dependent variable is not defined) B) 0 C)-1 d) 1
(18) The following function call statements contain [18] real parameters.
Func (exp1, exp2), (exp3, exp4, exp5 ));
[18] A) 1 B) 2 c) 4 d) 5
(19) run the following statement:
Char A = 3, B = 6, C;
C = a ^ B <2;
Then the binary value of C is [19 ].
[19] A) 00011011 B) 00010100 c) 00011100 d) 00011000
(20) there is an error in the program [20] below (the number before each program is a row number ).
1 # include <stdio. h>
2 main ()
3 {
4 float a [3] = {0, 0 };
5 Int I;
6 For (I = 0; I <3; I ++) scanf ("% d", & A [I]);
7 For (I = 1; I <3; I ++) A [0] = A [0] + A [I];
8 printf ("% F \ n", a [0]);
9}
(20) a) No B) 4th rows c) 6th rows d) 8th rows
(21) If the statement int A = 3 is set, then Statement A + = A-= A * A is executed. Then, the value of variable A is [21 ].
[21] A) 3 B) 0 C) 9 d)-12
(22) for loop below [22 ].
For (x = 0, y = 0; (y! = 123) & (x <4); X ++ );
[22] A) is an infinite loop B) the number of cycles is not fixed c) Execution 4 times d) Execution 3 times
(23) If the statement char a = '\ 72' is set, variable A [23 ].
[23] A) contains 1 character B) contains 2 characters C) contains 3 characters D) The description is invalid
(24) The output result of the following program is [24 ].
# Include <stdio. h>
# Include <Math .. h>
Main ()
{Int A = 1, B = 4, C = 2;
Float x = 10 .. 5, y = 4.0, Z;
Z = (a + B)/C + SQRT (double) y) * 1.2/C + X;
Pritnf ("% F \ n", Z );}
[24] A) 14.000000 B) 015.400000 c) 13.700000 d) 14.900000
(25) sizeof (double) is [25 ].
[25] A) A function call B) A double expression
C) an integer expression d) an invalid expression
(26) in C language [26 ].
[26] A) Do-while statements cannot be used to construct a loop.
B) the do-while statement must use the break statement to exit the loop.
C) the do-while statement. When the expression value in the while statement is non-zero, the loop ends.
D) the do-while statement. When the expression value in the while statement is zero, the loop ends.
(27) The output result of the following program is [27 ].
# Include <stdio. h>
# Include <string. h>
Main ()
{Char STR [12] = {'s ', 't', 'R',' I ', 'n', 'G '};
Printf ("% d \ n", strlen (STR ));}
[27] A) 6 B) 7 C) 11 d) 12
(28) The output result of the following program is [28 ].
# Include <stdio. h>
Main ()
{Int A = 2, c = 5;
Printf ("A = % d, B = % d \ n", a, c );}
[28] A) A = % 2, B = % 5 B) A = 2, B = 5 c) A = % d, B = % d) A = % d, B = % d
(29) The output result of the following program is [29 ].
# Include <stdio. h>
Main ()
{Int A, B, D = 241;
A = D/100% 9;
B = (-1) & (-1 );
Printf ("% d, % d \ n", a, B );}
[29] A) 6, 1 B) 2, 1 c) 6, 0 d) 2, 0
(30) The output result of the following programs is [30 ].
# Include <stdio. h>
Main ()
{Int I;
For (I = 1; I <= 5; I ++) {if (I % 2) printf ("*");
Else continue; printf ("#");}
Printf ("$ \ n ");}
[30] A) * # $ B) # * $ c) * # $ d) # * $
(31) The following for statements are executed for 31 times.
# Include <stdio. h>
# Define N 2
# Define m n + 1
# Define num (m + 1) * m/2
Main ()
{Int I, n = 0;
For (I = 1; I <= num; I ++ );
{N ++; printf ("% d", n );}
Printf ("\ n ");}
[31] A) 5 B) 6 c) 8 d) 9
(32) if the following statement is set, [32] is not a correct reference to the elements of array A, where 0 ≤ I <10.
Int A [10] = {,}, * P =;
[32] A) A [p-A] B) * (& A [I]) c) P [I] d) * (a + I ))
(33) there are the following procedures:
# Include <stdio. h>
# Define N 6
Main ()
{Char C [N]; int I = 0;
For (; I <n; C [I] = getchar (), I ++ );
For (I = 0; I <n; putchar (C [I]), I ++ );}
Enter the following three lines. Each line of input starts in the first column. <CR> indicates a carriage return:
A <CR>
B <CR>
Cdef <CR>
The output result of the program is [33 ].
(33) a) abcdef B) A C) a d)
B
C Cd cdef
D
E
F
(34) The following program calls the findmax function to find the subscript of the element with the largest value in the array. Please fill in the blanks.
# Include <stdio. h>
Findmax (S, T, K)
Int * S, T, * K;
{Int P; For (P = 0, * k = P; P <t; P ++)
If (s [p]> S [* k]) _________;}
Main ()
{Int A [10], I, K;
For (I = 0; I <10; I ++) scanf ("% d", & A [I]);
Findmax (A, 10, & K );
Printf ("% d, % d \ n", K, a [k]);}
[34] A) k = p B) * k = p-S C) k = p-S D) * k = P
(35) there are the following procedures:
# Include <stdio. h>
Union pw
{Int I; char ch [2];};
Main ()
{A. Ch [0] = 13; A. Ch [1] = 0; printf ("% d \ n", A. I );}
The output result of the program is [35 ]. (Note: ch [0] is in the lower byte, and CH [1] is in the upper byte .)
[35] A) 13 B) 14 C) 208 d) 209
(36) there are the following procedures:
# Include <stdio. h>
Main ()
{Int C;
While (C = getchar ())! = '\ N ')
{Switch (c-'2 ')
{Case 0:
Case 1: putchar (C + 4 );
Case 2: putchar (C + 4); break;
Case 3: putchar (C + 3 );
Case 4: putchar (C + 2); break ;}}
Printf ("\ n ");}
Enter the following data from the first column. <CR> indicates a carriage return.
2743 <CR>
The output result of the program is [36 ].
[36] A) 668977 B) 668966 c) 6677877 d) 6688766
(37) The output result of the following program is [37 ].
Main ()
{Char * Alpha [6] = {"ABCD", "ijkl", "mnop", "qrst", "uvwx "};
Char ** P; int I;
P = Alpha;
For (I = 0; I <4; I ++) printf ("% s", P [I]); printf ("\ n ");
}
[37] A) abcdefghijkl B) ABCD c) abcdefghijklmnop d) aeim
(38) The output result of the following program is [38 ].
# Include <stdio. h>
# Define fudge (y) 2.84 + Y
# Define PR (a) printf ("% d", (INT) ())
# Define print1 (a) Pr (a); putchar ('\ n ')
Main ()
{Int x = 2; print1 (fudge (5) * X );}
(38) a) 11 B) 12 C) 13 d) 15
(39) The output result of the following program is [39 ].
# Include <stdio. h>
Main ()
{Int I = 1, j = 3;
Printf ("% d", I ++ );
{Int I = 0; I + = J * 2; printf ("% d, % d", I, j );}
Printf ("% d, % d \ n", I, j );}
【39 】 A), 3, 3 B), 3 C), 3 D), 3
(40) The output result of the following program is [40 ].
# Include <stdio. h>
Main ()
{Int K = 4, M = 1, P;
P = func (K, M); printf ("% d,", P); P = func (K, M); printf ("% d \ n ", p );}
Func (A, B)
Int A, B;
{Static int m = 0, I = 2;
I + = m + 1; M = I + A + B; Return (m );}
(40) a) 8, 17 B) 8, 16 C) 8, 20 d) 8, 8
(41) The following statements are provided:
Char STR [4] [12] = {"AAA", "BBBB", "CCCCC", "dddddd "},
* STRP [4];
Int I;
For (I = 0; I <4; I ++) STRP [I] = STR [I];
[41] is not a correct reference to the string, where 0 ≤ k <4.
[41] A) strp B) STR [k] C) STRP [k] d) * STRP
(42) The following statements are provided:
Char str1 [] = "string", str2 [8], * str3, * str4 = "string ";
Then [42] is not the correct call to the library function strcpy. This library function uses the industry to copy strings.
[42] A) strcpy (str1, "hello1"); B) strcpy (str2, "hello2 ");
C) strcpy (str3, "hello3"); d) strcpy (str4, "hello4 ");
(43) in C language, the default Storage Class of parameters is [43 ].
(43) a) Automatic (auto) B) Static (static) c) Register (Register) d) external (extern)
(44) The following statements are provided:
Struct st {int N; struct st * Next ;};
Static struct st a [3] = {5, & A [1], 7, & A [2], 9, '\ 0'}, * P;
P = & A [0];
The value of expression [44] is 6.
[44] A) P ++-> n B) P-> N ++ C) (* P). N ++ d) ++ p-> N
(45) in the following four programs, [45] cannot exchange the values of Two integer variables.
[45] A) # include <stdio. h>
Main ()
{Int A = 10, B = 20; swap (& A, & B );
Printf ("% d \ n", a, B );
}
Swap (p, q)
Int * P, * q;
{
Int * t;
T = (INT) malloc (sizeof (INT ));
T = P; * P = * q; * q = * t ;}
B) # include <stdio. h>
Main ()
{
Int A = 10, B = 20;
Swap (& A, & B );
Printf ("% d \ n", a, B );
}
Swap (p, q)
Int p, q;
{
Int * t;
T = * P; * P = * q; * q = T;
}
C) # include <stdio. h>
Main ()
{
Int * a, * B;
* A = 10, * B = 20;
Swap (A, B );
Printf ("% d \ n", * a, * B );
}
Swap (p, q)
Int * P, * q;
{
Int T;
T = * P; * P = * q; * q = T;
}
D) # include <stdio. h>
Main ()
{
Int A = 10, B = 20;
Int x = & A, y = & B;
Swap (x, y );
Printf ("% d \ n", a, B );
}
Swap (p, q)
Int * P, * q;
{
Int T;
T = * P; * P = * q; * q = T;
}
2. Fill in blank questions (2 points for each blank question, 40 points in total)
Write the correct answer for each blank answer on the horizontal line after the answer card 1-20. The answer is not scored on the exam.
(1) The three basic control structures stipulated in the structured program design are [1] structure. Select the structure and cycle structure.
(2) In the seven-digit ASCII code, in addition to numbers, uppercase and lowercase letters, there are also [2] other symbols.
(3) run the [3] command to copy all files without an extension to the ABC subdirectory of drive B's bas sub-directory ].
(4) The Chinese meaning of RoM in microcomputer is [4] memory.
(5) After starting the MS-DOS system, the batch processing file that can be automatically executed is [5]. bat.
(6) set the current disk to drive C, and delete all files with the. txt extension in the fox subdirectory of drive B. The command is [6 ].
(7) convert the decimal number 53 to the hexadecimal number [7 ].
(8) There are three common data models in the database management system: hierarchical, mesh, and [8.
(9) after buying a new disk, you must [9] process it before saving the file.
(10) In a microcomputer, character comparison is to compare their [10] codes.
(11) The following C language program copies one file on the disk to another file. The two file names are provided in the command line.
# Include <stdio. h>
Main (argc, argv)
Int argc; char * argv [];
{File * F1, * F2; char ch;
If (argc <[11 ])
{Printf ("parameters missing! \ N "); exit (0 );}
If (F1 = fopen (argv [1], "R") = NULL) | (F2 = fopen (argv [2], "W "))
= NULL ))
{Printf ("can not open file! \ N "); exit (0 );}
While ([12]) fputc (fgetc (F1), F2 );
Fclose (F1); fclose (F2 );}
(12) The trap function in the following program is a general function that uses the trapezoid Method to Determine the integral. The formula for determining the integral using the trapezoid method is:
N-1 A-B
S = (f (a) + F (B)/2 + Σ f (a + I * H) * H, H = | ---- |
I = 1 N
Where, n is the number of integral cells. The following program calls the trap function to calculate the credits. The accumulate function is:
F (x) = x * x + 3 * x + 2, and n = 1000, A = 0, B = 4.
# Include <stdio. h>
3 include <math. h>
Double Trap (fun, a, B)
Double (* Fun) (), A, B;
{Double T, h;
Int I, n = 1000;
T = 0.5 * (* Fun) (A) + (* Fun) (B); H = FABS (a-B)/(double) (n );
For (I = 1; I <= n-1; I ++) t = T + [13 ];
T = T * h; Return (t );}
Double mypoly (X)
Double X;
{Return (x * x + 3.0 * x + 2.0 );}
Main ()
{Double Y, (* PF) (); pF = [14 ];
Y = trap (PF, 0.0, 4.0); printf ("% F \ n", Y );}
(13) The following program calculates the sum of all prime numbers in array A. The isprime function is used to determine whether the independent variable is a prime number. A prime number is a natural number that can only be divided by 1 and itself and is greater than 1.
# Include <stdio. h>
Main ()
{Int I, a [10], * P = A, sum = 0;
Printf ("Enter 10 num: \ n ");
For (I = 0; I <10; I ++) scanf ("% d", & A [I]);
For (I = 0; I <10; I ++)
If (isprime (* (p + [15]) = 1) {printf ("% d", * (a + I )); sum + = * (a + I );
}
Printf ("\ nthe sum = % d \ n", sum );}
Isprime (X)
Int X;
{Int I; for (I = 2; I <= X/2; I ++)
If (X % I = 0) Return (0); [16 ];}
(14) The following program calls the invert function to re-place the values of elements in array a in reverse order. The value in array a is read in the main function.
# Include <stdio. h>
# Define N 10
Invert (S, I, j)
Int * s, I, J;
{Int t; if (I <j) {T = * (S + I); * (S + J) = (S + J); * (S + J) = T; invert (s, [17], J-1 );}}
Main ()
{Int A [n], I;
For (I = 0; I <n; I ++) scanf ("% d", A + [18 ]);
Invert (A, 0, N-1 );
For (I = 0; I <n; I ++) printf ("% d", a [I]);
Printf ("\ n ");}
(15) The following program creates a one-way linked list with a header node. Data in the linked list node is input through the keyboard. When the input data is-1, indicates that the input is over (the data field at the head node of the linked list does not contain data, and the table is empty if it is pH-> next
= NULL ).
# Include <stdio. h>
Struct list {int data; struct list * Next ;};
[19] creatlist ()
{Struct list * P, * q, * pH; int;
PH = (struct list *) malloc (sizeof (struct list ));
P = q = Ph; printf ("input an integer number, enter-1 to end: \ n ");
Scanf ("% d", & ):
While (! =-1)
{P = (struct list *) malloc (sizeof (struct list ));
P-> DATA = A; q-> next = P; [20] = P; scanf ("% d", & );}
P-> next = '\ 0'; Return (ph );}
Main ()
{Struct list * head; head = creatlist ();}