C Language Exercises It is only used for review in the process of C language learning, not for other purposes. A total of 40 questions, 2.5 points for each question, no points for more choices and fewer mistakes. 1 The following option (B) is a preliminary tool for explaining an algorithm. (Choose one) A Programs B Flowcharts C Loops D Instructions E Codes 2 In the process of software design, when a flow chart has several pages, it should use (C) to identify the cross-page flow. (Choose one) A process line B branch symbol C connector D start and end box 3 In C, the following option (A D) is a valid variable name.(Choose two) A Minimum B 3rd_row C n1+n2D Doubles E First.name 4 In C, the user identifiers listed in the following option (C) are illegal. (Select one) A P_0 do B float la0_A C B-A go to int D_123 temp INT 5 The rules for naming a variable in C language include (AD).(Choose two) Variable A names must begin with letters or underscores The first letter of a B variable must be a letter, a number, or an underscore. C variable names are case-insensitive The first letter of D can be a sequence of letters, numbers and underscores. 6 In C, we have to do (A) when allocating memory for a particular data. (Choose one) A defines a variable B of a particular data type, defines a value C, defines a pointer D of a particular data type, and no more. In C language, int type data occupies (B) bits in memory.(Select one)//4 bytes, 4*8 (bit) A 32 B 16 C 8D 64 8 In C, 15+80/2*10-12*2/3-10 The calculation result of the above expression is (C).(Choose one) A 298 B 553 C 397 D– 533 9 In C language, (10*(2-8)+10)/(5-5*2) The calculation result of the above expression is (B).(Choose one) A-10 B 10 C 30 D -32 10 In C, the following options (C) can perform operations on a given number (select one) Operand B Operations Neither Operators D nor above is correct. In C, 19 + 12 is here, 19 and 12 are (A), +are (). (Choose one) A Operator, Operator B operator, operand C variable, operand D operation, operand 12 In C language, hypothesis i s defined as: int i; char c, * s; float f, g; The result is an integer expression (BD).(Choose two) 11 A i+f B i*c f*(int)g D*s-&apos;A&apos;+48 13 int x = 10, y = 20, result; x + = 20; result = x + y; Printf ("result=% d", result); The output of the above program segment is (B).(Choose one) A result = 30B result = 50C result = 40D result = 60 14 In C, to display the square root of a number (variable i), the following code is correct (B).(Choose one) A printf (sqrt (t), " n Square of% d", i) B printf (" n Square of% D is% f", i, sqrt (i))) C printf (sqrt(i), i, t,"n Square of%d is%d") D printf (i, t,"n Square of%d") E scanf(i,"n Square of%d is%d",sqrt(i)) 15 Void main () {char ch; ch=&apos;a&apos;+3; putchar (ch); } The output of the above C language code is (D).(Choose one) A B 100 C D 16 Describing A:&apos;8&apos;is the same as describing 8. Describing the data type of B:&apos;$&apos; is the correct description of option (D) under char. (Choose one) A Both descriptions are correct. B Both descriptions are wrong. C is only correct in describing A. D only describes B correctly. 17 void main () {int a = 100, X = 10, y = 20, OK1 = 5, ok2 = 0; if (x < y) { If (Y! =10) {if (! Ok1) a = 1; } If (ok2) A = 10; a = 1; printf ("% d n", a); } } The output of the above C program is (C) (select one) A 1B 0C-1D Value Uncertainty 18 In C language, there are the following programs: Void main () { Int i; For (i = 0; I < 3; I + +) switch (i) {case 1: printf ("% D", i); case 2: printf ("% D", i); default: printf ("% D", i); } } The output after execution is (A).(Choose one) A 011122 B 012 C 12020 D 120 19 In C, the following description of conditional statements is correct (AC). (Choose two) A When the if statement is nested, the last else matches the latest if without an else match B An if can have more than one else to match it C A switch statement can always be replaced by a series of if else statements The test expression for a D switch statement can be of any type E When the break statement is executed, the program stops executing 20 In C, in int num [5]={10, 20, 30, 40, 50}, the value of num [3] is (C). (Select one) A 30 B 50 C 40 D 10 21 If specified: int a [10]; then the correct reference to a array element is (BD).(Choose two) A [10] B a [3 + 1] C a (5) Da [0] 22 In C, the following (ABD) function is defined in the library file string. H. (Choose three) A strlen () B strcat () C strcon () D strcpy () E

docxDoc C Language Exercises - Classics - Essence

Professional Docs > Common > Other > Preview
9 Pages 0 Downloads 50 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 11:59:59
Rate
You can enter 255 characters
What is my domain?( answer:www.45doc.com )
comments
  • No comments yet