Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Can any senior provide a C++ program fill-in-the-blank question bank (it would be best if it at least has answers and analysis). The more questions, the better. That way it will be more comprehensive
Can any senior provide a C++ program fill-in-the-blank question bank (it would be best if it at least has answers and analysis). The more questions, the better. That way it will be more comprehensive
Can any senior provide a C++ program fill-in-the-blank question bank (it would be best if it at least has answers and analysis). The more questions, the better. That way it will be more comprehensive and intensive. Thank you.

This is part of it, the rest can be downloaded from Baidu Library and I will upload it to you.

Search directly for "C Language Programming_Review Questions with Answers_"

C Language Basics 1:

1. Among the following four sets of options, none of them are The option for C language keyword is (A).

A) define B) gect C) include D) while

IF char scanf go

type printf case pow

2. Among the following four options, the option that is a legal integer constant is (A).

A)160 B)-0xcdf C) -01 D)-0x48a

-0xffff 01a 986,012 2e5

011 0xe 0668 0x

< p><<02>>B>>2

3. Among the following four options, the one with illegal escape characters is (B).

A) '\"' B) '\1011' C) '\011' D) '\abc'

'\\' '\' '\f' ' \101'

'xf' '\A' '\}' 'x1f'

4. The incorrect string constant below is (A)

<. p>A)'abc' B)"12'12" C)"0" D)" "

5. The illegal user identifier in the following options is (A)

.

A)abc.c B)file C)Main D)PRINT

6. The legal keyword provided by C language is (D)

A) swith

p>

B) cher

C) Case

).Default

7. Among the following identifier groups, the legal user identifier is A

A)_0123 and ssiped

B)del-word and signed

C) list and *jer

D) keep% and wind

8. In C language, the logical value "true" is represented by (C)

A) true B) integer value 0 C) not another integer. Type value D) T

9If there is the following definition

char s='\092';

then the statement (B)

< p>A) Make the value of s contain one character B) The definition is illegal and the value of s is uncertain

C) Make the value of s contain 4 characters D) Make the value of s contain 3 characters< /p>

10 Assume that in C language, int type data occupies 2 bytes, then float type data occupies (D) bytes.

A)1 B)2 C)8 D. )4

11 It is known that the ASCII code of the letter A is the decimal number 65, and c2 is a character type, then after executing the statement c2='A'+'6'-'3', the value in c2 is (A).

A)D B)68 C) Uncertain value D)C

12 The data type of the operands on both sides of the logical operator is (D).

A) It can only be 0 or 1 B) It can only be 0 or non-0 positive number

C) It can only be integer or character data D) It can be any legal type Data

The number of bytes occupied by int type variables in 13TURBO C is (B).

A)1 B)2 C)3 D)4

14 In C language, the storage form of char type data in memory is (D).

A) Complement code B) Inverse code C) Original code D) ASCII code

15 If there is the following definition, the expression that can make the value 3 is (D).

int k=7, x=12;

A)x%=(k%=5) B)x%=(k-k%5) C)x%=k-k %5 D)(x%=k)-(k%=5)

16The correct expression to determine whether the char type variable c1 is a lowercase letter is (D).

A) 'a'<=c1<='z' B) (c1>=A. &&(c1<='z')

C) ('a' >=c1)||('z'<=c1) D) (c1>='a')&&(c1<='z')

17 The types of known variables are described as follows:

int k,a,b;

unsigned long w=5;

double x=1.42

The following does not comply with C The expression of language grammar is (A).

A)x%(-3)

B)w+=-2

C)k=(a=2,b=3,a+ b)

D)a+=a-=(b=4)*(a=3)

If t is double type, the expression t=1,t+5, The value of t++ is (D).

A)1 B)6.0 C)2.0 D)1.0

Suppose n=10, i=4, then the value of n after the assignment operation n%=i+1 is executed Yes (A).

A) 0

B) 3

C) 2

D) 1

< p>Suppose Int n=3; then there is the expression ++n, and the result of n is (C).

A)2 B)3 C)4 D)5

When entering a signed integer in decimal form, the format character in the scanf function statement is (AB).

A) d B) i C) n D) u

The modifiers available in the scanf function statement are (ABCD).

A) * B) h C) l D) width

1 Data is the object of operation, and the result of the operation will change the status of the data.

2 character variables are used to store character constants. Note that only 2 characters can be stored. Wrong

In 3C language, a string can be assigned to a character variable. Wrong

4 Real variables in C language are divided into two types, they are float (real type) and double (double precision real type). Wrong

5 In C language, the operator that requires the number involved in the operation must be an integer is %. Right

6 If there is the following definition, execute the following expression y+=y After -=m*=y, the value of y is -6. int m=5,y=2; The format of the input statement for

7 is: scanf("%d%d%d",&a,&b,&c); is correct. Yes

8 In the scanf("%d,%d",&a,&b) function, you can use one or more spaces as the interval between two input numbers. Wrong

9The function of getchar function is to receive a string of characters input from the keyboard. Wrong

10 The method of assigning an initial value to a variable in the variable description is: int a=b=c=10; Wrong

12 The printf function is a standard library function, and its function The prototype is in the header file "stdio.h".

Yes

13 The printf function is called the format input function, and its function prototype is in the header file "stdio.h". Wrong

14 In the printf function, the order of evaluation of the output table columns in different systems is not necessarily the same. TC is performed from right to left. Yes

15 If int x=3; printf("%d",&x);, the system will report an error without any results. Wrong

16 Logical operators have higher priority than arithmetic operators Wrong

1 In C language, the logical "true" value is represented by 1.

2 The data type of the expression pow(2.8,sqrt(double(x))) value is (doubt).

3 Assuming that all variables are integers, the value of the expression (a=2,b=5,b++,a+b) is 8.

4If x is an int type variable, after executing the following expression, the value of x is 12. x=(a=4,6*2)

5 If k is an int integer variable and is assigned a value of 7, please write the operation result 70 of the assignment expression k *= k + 3.

The 6scanf function is a standard library function, and its function prototype is in the header file stdio.h.

7The getchar function can receive a single character, and input numbers are also processed as characters.

8 In a statement, when assigning a value to a variable, the assignment statement must end with a semicolon.

9 When a=3, b=2, c=1, the value of the expression f=a>b>c is 0

10 Let x, y, z all It is an int type variable. Please write an expression that describes "one of x and y is a negative number" x<0&&y>=0||y<0&&x>=0

11 If a=6, b =4, c=3, then the value of the expression a&&b||b-c is 1

12 Suppose x=3, y=-4, z=5, then the expression !(x>y)+ The value of (y!=z)||(x+y)&&(y=z) is 1

Basic 2

1 Among the four options below, they are all illegal constants The option is (A).

A)'as' B)'\\' C)-0x18 D)0xabc

-0fff '\01' 01177 '\0'

'\0a' 12,456 0xf "a"

2 Among the following four options, the option that is an illegal integer constant is (D).

A)-0f1 B)-0xcdf C) -018 D)-0x48eg

-0xffff 017 999 -068

0011 12,456 5e2 03f

3The correct character constant below is (C).

A) "c" B) '\\'' C) 'W' D) '

4 Each of the following options represents a constant, among which the correct integer constant Yes(B).

A)1.2 B)-20 C)1,000 D)4 5 6

5The illegal user identifier in the following options is (C).

A)_123 B)Printf C)A$ D)Dim

6 In the following C language program, the variable name that can be used is (B).

A) 1

B) a1

C) int

D) *p

7C language The legal data key provided is (A).

A) float

B) Sagned

C) Integer

D) Char

8 symbols or less The symbol that cannot be used as a user identifier is (B).

A)_256 B)void

C)scanf D)Struct

9 If k is an int type variable, then the following statement (C).

k=8567;

printf("|%-06d|\n",k);

A) The output format description is illegal B) The output is |008567|

C) The output is |8567| D) The output is |-08567|

10sizeof(float) is (B).

A) A double precision expression B) An integer expression

C) A function call D) An illegal expression

11 In C language, the number of bytes occupied by int, char and short data in memory (D).

A) Defined by the user B) Both are 2 bytes

C) Any D) Determined by the machine word length of the machine used

12The correct expression to determine whether the char type variable c1 is a lowercase letter is (D).

A) 'a'<=c1<='z' B) (c1>=A. &&(c1<='z')

C) ('a' >=c1)||('z'<=c1) D) (c1>='a')&&(c1<='z')

13 The following statement is correct (B) .

A. a is a real type variable. C language allows the following assignment a=10, so it can be said that integer values ??are allowed to be stored in real type variables

B. In an assignment expression, the right side of the assignment number can be a variable or any expression

C. After executing the expression a=b, the original values ??in the memory units a and b will be changed. The value of a has been changed from the original value to the value of b, and the value of b has been changed from the original value to 0

D. Already a=3, b=5. After executing the expressions a=b, b=a, the value in a is 5 and the value in b is 3

14 Expression 18/ The data type of the 4*sqrt (4.0)/8 value is (C).

A)int B)float C)double D)uncertain

15 Among the following operators, the one that is not a relational operator is (C).

A) < B) > = C) ! D) ! =

16 If you want the value of the expression to be true when the value of A is an odd number, the value of A is When it is an even number, the value of the expression is false, then the following expression that cannot meet the requirements is (C).

A) A%2= =1 B) !(A%2= =0) C) !(A%2) D) A%2

17 It is known that each The type description of the variable is as follows:

int i=8,k,a,b;

unsigned long w=5;

double x=1.42,y =5.2;

Then the following expression that conforms to C language grammar is (A).

A)a+=a-=(b=4)*(a=3)

B)a=a*3=2

C) x%(-3)

D)y=float(i)

18 If the variable has been correctly defined and assigned a value, the following expression that conforms to C language syntax is (B).

A)a=a+7; B)a=7+b+c,a++ C)int 12.3%4 D)a=a+7=a+b

19 comma expression (a=3*5, a*4), the value of a+15 is (C).

A)15 B)60 C)30 D) Uncertain

20Suppose Int n=3; then the result of n++ is (B).

A)2 B)3 C)4 D)5

1 When inputting real numbers in decimal or exponential form, the format character in the scanf function statement is (BCD).

A) i B) f C) e D) g

2 You can use (CD) to input character data.

A) putchar(c); B) getchar(c); C) getchar(); D) scanf("%c",&c);

1 Data in C language There are constants and variables.

2 Generally, a character variable occupies one byte in memory.

3C language stipulates that variables can be initialized at the same time when defining variables.

4 The definition statement to define k1 and k2 as basic integer variables and assign an initial value of 0 is int k1=k2=0;. Wrong

5 If the original value of i is 3, then: j = ++ i, the value of j is 3. Wrong

6Every expression has a value.

7 The format of the input statement is: scanf("%d,%d,%d",a,b,c); which is correct. Wrong

8 In the scanf("%d,%*d,%d",&a,&b) function, when the input is 1, 2, 3, 1 is assigned to a and 2 is assigned Give b. Wrong

9The function of the getchar function is to receive an integer input from the keyboard. Wrong

10 Assuming that variables a, b, c have been assigned initial values ??during description, then if ((a=b;)>0) c=a; is correct. Wrong

11

12 The printf function is a standard library function, and its function prototype is in the header file "string.h". Wrong

13 In the printf function, the meaning of the format character d is: output a signed integer in decimal form.

14 In the printf function, the output items of the output table column can be separated by colons. Wrong

15 If int x=3; printf("%d",&x);, the system will not report an error and will output the address of x.

16int a=0, b=1, c=2; then the value of the expression a||b+c&&b==c is 0

1 If there is the following definition: char c='\010';Then the number of characters contained in variable C is (1).

2 If there is the following definition: int x=3,y=2;float a=2.5,b=3.5; then the value of the following expression is 1. (x+y)%2+(int)a/(int)b

3 If a is an int type variable and the initial value of a is 6, then after executing the following expression, the value of a is 60. a+=a-=a*a

4If x is an int type variable, then after executing the following expression, the value of x is 4. x=a=4,6*2

5 If a is an int variable and the initial value of a is 6, the value of a after calculating the expression is 60. a+=a-=a*a

The address of each variable is given in the address table column of the 6scanf function. The address is composed of the address operator "&" followed by the variable name.

7 Use the getchar function to receive characters. If more than one character is entered, only the first character is received.

8 The format output function of C language is printf().

9When a=5, b=4, c=2, the value of the expression a>b!=c is 1

10It is known that A=7.5, B= 2, C=3.6, the expression A>B&&C>A || The value of AB is 0

11 If a=3, b=2, c=1, then the expression The value of a-b

12 has int a=0, b=4, c=5; then the value of the expression a||b+c&&b!=c is 1

Basic Three

1 Among the following four options, the option that is an illegal user identifier is (C).

A) A B) float C) b-a D) _123

p_0 lao goto temp

do _A int INT

2 the following four Among the options, the option that is an illegal floating point number is (B).

A) 160. B) 123 C) -018 D) -e3

0.12 2e4.2 123e4 .234

e3 .e5 0.0 1e3

p>

3 Among the four options below, the one with incorrect octal or hexadecimal numbers is (D).

A)016 B)0abc C)010 D)0a12

0x8f 017 -0x11 7ff

018 0xa 0x16 -123

4 Each of the following options represents a constant, and the incorrect real constant is (B).

A)2.607E-1 B)0.8103e 2 C)-77.77 D)45.6e-2

5 The set of identifiers that can be used as user identifiers is ( B ).

A)void B)a3_b3 C)For D)2a

define _xyz -abc DO

WORD IF Case sigeof

6 Among the following identifier groups, the legal user identifier is (B).

A) PAd and p#d

B) Scanf and a10

C) void and max

D) A* and temp

7 (B) is a legal data type keyword provided by C language.

A)Float B)signed C)integer D)Char

8 The correct constant in the following options is (B).

A) 012

B) -20

C) 1,000

D) 4 5 6

< p>9The integer variable int i=1 has been defined;

After executing the loop statement while(i+ +<5);, the value of i is (B).

A)1 B)5 C)6 D) The above three answers are incorrect

10 Assume variable a is an integer type, f is a real type, and i is a double precision type , then the data type of the expression 1'a'+i*f value is (C).

A)int B)float C)double D)unsure

11 If there is a description statement: char c='\72'; then the variable c (C).

A) Contains 1 character B) Contains 2 characters

C) Contains 3 characters D) The description is illegal, the value of c is uncertain

12 Assume that A ).

A) 'x'&&'z' B) (!y= =1)&&(!z= = 0)

C) (x

13 The correct statement below is (B).

A) In a C program, whether it is an integer or a real number, it can be accurately represented within the allowed range

B) If after the definition statement double a, b; , because variables a and b have been correctly defined, it is correct to execute such an expression immediately: a=b+9.381

C) In C programs, constants, variables, and function calls are all expressions A kind of formula

D) In ??the main function, once the variable is defined, the system will automatically assign an initial value

14 has a description: char w; int x; float y; double z; then the data type of the expression w*x+z-y value is (C).

A) float B) char C) int D) double

15 Suppose a=2, b=3, c=4, then the expression a+b>c&&b= = The value of c&&a||b+c&&b+c is (D).

A) 5 B) 8 C) 0 D) 1

16 In C language, the logical value "true" is represented by (D).

A) true B) integer value 0 C) non-integer value D) T

The following incorrect statement in 17 is (C).

A) In the C program, the comma operation has the lowest priority

B) In the C program, APH and aph are two different variables

C) If a and b are of the same type, after calculating the assignment expression a=b, the value in b will be put into a, but the value in b will not change

D) When inputting data from the keyboard When , only integer values ??can be entered for integer variables, and only real values ??can be entered for real variables

18 The following expressions result in integer types (assuming int i; char c; float f ;) It's (D).

A)i+f B)i*c C)c+f D)i+c+f

19 There is a comma expression (a=3*5, a *4), a+15, the value of a is (B).

A)60 B)30 C)15 D)90

20Suppose Int n=3; then there is the expression n++, and the result of n is (C).

A)2 B)3 C)4 D)5

1 (ACD) can be used if there are no non-format characters as intervals for input data in the scanf function statement.

As the interval of input data.

A) Space B) Comma C) TAB D) Enter

2 When using the scanf function, at the beginning of the source program (ABC).

A) Write #include "stdio.h" B) Write #include

C) No need to write #include D) Write #include "scanf.h"

1C language stipulates that identifiers can only consist of three characters: letters, numbers, and decimal points.

2 C language makes character data and integer data interchangeable. A character data can be output in character form or integer form. Yes

3 A variable is defined in C language to represent an address in memory. The expression 3.5 + 1/2 + 56%10 evaluates to 7.5

4.

5 An expression that connects a variable and an expression by an assignment operator is called an "assignment expression". Right

6 Assume that in C language, an int type data occupies 2 bytes in the memory, then the value range of int data is -32768-32769.

7The header file "math.h" should be included before using the scanf function.

8 In the scanf("%c%c",&c1,&c2) function, when the input is the characters a and b, a is assigned to c1 and b is assigned to c2.

9 In the scanf function, if there are ordinary characters in the format control string, the ordinary characters must also be entered when inputting.

10 Assuming that variables x, y, and z have been assigned initial values ??during description, then if ((x=y+5)>0) z=x; is correct

11The format characters in the printf function can be either uppercase or lowercase.

12In the printf function, the format character "%5c" can be used to output 5 characters.

13 In the printf function, the meaning of the format character s is: output a single character.

14 In the printf function, the output item can be any legal expression.

15 Arithmetic operators have higher precedence than relational operators

16 int a=0, b=1, c=2, x, y;, then!(x= The value of a)&&(y=b)&&c is 1