C Language Programming Reference Questions Note: This question only reflects the type of the examination, as a reference for review before the examination. Through these typical topics, we should master the contents listed in the review points.The given topic should not be memorized by rote, but grasp the key points and important algorithms through the topic. I. Single Choice Questions 1. The basic unit of C program is the statement of [C]A file B command C) function D. 2. The error in the following description is that the position of main () function in [C] A) C program can be arbitrary B) C program can be composed of multiple program files, and a program file can be composed of one or more functions C) Each program file has a main () function D) C program.Always start with main () and end with it 3. The process of converting C source program to target program is called [B]A edit B compile C) connect D run. 4. The basic data types in C language include integer, real and logical B, real and character C, logical and character D, real and string. 5. The following illegal user identifiers are [C]A)j2_KEY B)Double C)4d)_8_ 6. The numeral system that cannot be represented in C source program is [A] A) binary B) octal C) decimal D) hexadecimal system. 7. The following legal character constants are [A] A&apos; x13 `B&apos;, 1 `C&apos;&apos;65 `D&apos;, n&apos;. 8. Among the following options, [D]A)o115 B)0118C)1.5e1.5D)115L can be used as a data constant 9. In C language, the operator requiring that the operation object must be integer data is [A]% B) / C) D.&& 10. The C language expression expressing the mathematical relationship "x (> y (> z) is [C] A) x >= y >= Z B) x >= y | | y >= Z C) x >= Y & & Y >= Z D) x > y (> Z (> z). 11. If all variables are correctly defined and assigned, the following legal C language assignment statements are [A] A) x = y= 5; B) x = n% 2.5; C) x + n = j; D) x = 5 = 4 + 1; 12. Definition: int k = 0; the value of [A] A) K + + B) K + = 1 C + + K D) K + 1 is different from that of the other three expressions in the following options 13. If there are The following errorsCThe linguistic expression is [ C]A)A/b/c*e*3B)3*a*e/b/c)3*a*e/b*c D)A*e/c/b*3 algebraic expressions: 14. Assuming that the variable a is integer, f is real and I is double-precision, the data type of the expression 10+&apos;a&apos;+i*f value is [C]A)int B)float C)double D) uncertain. 15. If P and X have been correctly defined, X has been assigned, and p=&x, then the following relational expressions have a value of 1, [B]A) p==x B)*p==x C) & p==x D)*x==p 16. When the user requests that the input string contain spaces, the input function to be used is [C] A, scanf () B, getchar () C), gets () D) Getc (). 17. The following statements that can output strings in the character array STR are [B] A) printf ("% C", str [0]); B) printf ("% s", str); C) printf ("% s", str []); D) charputter (str); 18. There are input statements: scanf ("% d,% d", & a, & b); in order to make variables A and B 5 and 3 respectively, the correct form of input data from keyboard is [B] A) 53 < Enter > B) 5, 3 < Enter > C) a = 5B = 3 < Enter > D) a = 5, B = 3 < Enter > Enter > D) a = 5, B = 3 < Enter > B > 5. 19. Define the following variables and arrays: int j; int x [3] [3]={1,2,3,4,5,6,7,8,9}; then the output of the following statement is [C] for (j=2; J >=0; j--) printf ("% 2d, x [j][2-j]); A) 159 B) 147 C) 7 53D) 369 D 20. After executing the following program, the value of a is [B] define SQR (x) x * x void main () {int a = 10, k = 2, M = 1; a = SQR (k + m); printf ("% d n, a);} A) 10B) 5C) 2D) 1. 21. The basic form of a simple if statement: if (expression) statement [D], where "expression" A must be a logical expression B) must be a relational expression C) must be a logical expression or a relational expression D) can be any legitimate expression. 22. When nesting if statements, C language specifies that else always [C] A and previous if pair B with the same indentation position as it, and previous if pair C with its nearest if, and previous if pair D with its nearest if without else) and previous first if pair. 23. The following statement is correct that [D] A) break statement can only be used for switch statement B) default C break statement must be used in switch statement D must be paired with case in switch statement D) break statement is not necessarily used in switch statement. 24. There are the following program segments: x=-1; do x

docxDoc C Voice Reference Question (with answers)

Professional Docs > Common > Other > Preview
21 Pages 0 Downloads 63 Views 3.0 Score
Tips: Current document can only be previewed at most page8,If the total number of pages in the document exceeds page 8,please download the document。
Uploaded by admin on 2019-10-15 12:06:37
Rate
You can enter 255 characters
What is my domain?( answer:www.45doc.com )
comments
  • No comments yet