当前位置:网站首页>2. operator and expression multiple choice questions
2. operator and expression multiple choice questions
2022-06-25 14:57:00 【--988】
1、 according to C User identifier naming rules specified by language , What cannot appear in the identifier is (B).
A. Capital
B. Connector
C. Numeric character
D. Underline
2、 What is wrong in the following statement is (A).
A. User defined identifiers allow the use of keywords
B. The user-defined identifier should try to “ Know what you know ”
C. User defined identifiers must start with letters or underscores
D. User defined identifiers , Big 、 Lower case letters represent different symbols
remarks :① The user identifier consists of letters 、 Underline 、 Numbers are made up of these three aspects , But it must start with a letter or an underscore ;
② System reserved keywords cannot be used ;
③ Case sensitive , Can be used as a variable name .
3、C The operator in the language that an object must be an integer number is (A).
A.%
B.\
C.% and \
D./
The object of the remainder operation is an integer number
4、 The following can correctly define the shaping variables a、b and c Give them initial values 5 The sentence is (D).
A.int a=b=c=5; ( Initialization cannot use this form of continuous assignment )
B.int a,b,c=5; ( Only to c assignment 5)
C.a=5,b=5,c=5;( To illustrate a,b,c The type of )
D.int a=5,b=5,c=5;
5、 Execute the following two statements “int c=1,c2=2,c3;c3=1.0/c2*c1;” after , Variable c3 The value of is (A).
A.0
B.0.5
C.1
D.2
The result of the expression on the right is 0.5, But because of the assigned variable c3 Is an integer , Therefore, the integer part is assigned to c3, namely c3 As the result of the 0.
6、C The simplest data types in the language include (B).
A. integer 、 implement 、 The logical model
B. integer 、 Real type 、 Character
C. integer 、 Character 、 The logical model
D. integer 、 Real type 、 The logical model 、 Character
7、 In the following options , The value is 1 The expression of ().
A.1-'0'
B.1-'\0'
C.'1'-0
'\0'-'0'
The difference in value between a number and its corresponding character 48, namely ‘0’ Of ASCII by 48,‘1’ by 49, In turn , and ‘\0’ Is an empty character ,ASCII by 0, So only B The result of the option is 1
8、 The following variable definitions are set “int k=7,x=12”, Can make the value 3 The expression of (D).
A.x%=(k%=5)
B.x%=(k-k%5)
C.x%=k-k%5
D.(x%=k)-(k%=5)
9、 set up x and y Are all int Type variable , Then the statement “x+=y;y=x-y;x-=y” The function is (D).
A. hold x and y Arrange from large to small
B. hold x and y Arrange from small to large
C. No definite result
D. In exchange for x and y The value in
10、 Integer variables x and y The values of are equal and non 0 value , Then... In the following options , The result is 0 The expression of (D).
A.x||y
B.x|y
C.x&y
D.x^y
^ For XOR operation , Otherwise 1, Same as 0
& For and operation , If both values are true 1, If there is a false value, it is false
11、 The following about unary operators ++、-- What's right in my account is (C).
A. Their operands can be any variable or constant
B. Their operands can be char Type variables and int Type variable , But it can't be float Type variable
C. Their operands can be int Type variable , But it can't be double Type variables and float Type variable
D. Their operands can be char Type variable 、int Type variables and float Type variable
12、 Set variables x by float Type and assigned , Then... Can be used in the following statements x Keep the value in to two decimal places , And the third digit is rounded off (C).
A.x=x*100+0.5/100.0;
B.x=(x*100+0.5)/100.0;
C.x=(int)(x*100+0.5)/100.0;
D.x=(x/100+0.5)*100.0;
13、 If there are the following definitions “char a;int b;float c;double d;”, Expression a*b+d-c The type of value is (D).
A.float
B.int
C.char
D.double
Arithmetic conversion : When two operand types are different , At least one of these types needs to be converted to the other , Sometimes both may have to be converted into int type , Otherwise, the operation will not . The following is based on the priority of the transformation :
long double
double
float
unsighed long int
long int
unsighed int
int
14、 Of the following options , Illegal character constants are (C).
A.'t'
B.'n'
C."n"
D.'\t'
Characters are mainly divided into single characters enclosed in single quotation marks and escape characters , Note the escape characters
边栏推荐
- QT file reading -qfile
- One question per day, a classic simulation question
- Is it normal to dig for money? Is it safe to open a stock account?
- [try to hack] vulhub shooting range construction
- How to view the Chrome browser plug-in location
- 从408改考自主命题,211贵州大学考研改考
- Two common ways for orcale to clear table data
- [Ocean University of China] Data Sharing for retest of initial Examination
- New good friend Pinia, leading the new era of state management
- Common formatting methods for amount numbers
猜你喜欢

How to view the Chrome browser plug-in location

Gif动画怎么在线制作?快试试这款gif在线制作工具

From 408 to independent proposition, 211 to postgraduate entrance examination of Guizhou University

How to combine multiple motion graphs into a GIF? Generate GIF animation pictures in three steps

【中国海洋大学】考研初试复试资料分享

【Try to Hack】vulnhub DC1

Character encoding minutes

定位position(5种方式)

Yolov3 spp Darknet version to caffemodel and then to OM model

Add the resources directory under test in idea
随机推荐
How to cut the size of a moving picture? Try this online photo cropping tool
One question per day,
BM setup process
[Ocean University of China] information sharing for the first and second examinations of postgraduate entrance examination
[deep learning] multi label learning
Uniapp icon configuration
Extend JS copy content to clipboard
dmsetup命令
[try to hack] vulhub shooting range construction
NBD Network Block Device
有哪个瞬间让你觉得这个世界出bug了?
In 2022, the score line of Guangdong college entrance examination was released, and several families were happy and several worried
NBD Network Block Device
dev/mapper的解释
What moment makes you think there is a bug in the world?
Clinical Chemistry | 张建中/徐健开发幽门螺杆菌单细胞精准诊疗技术
Two common ways for orcale to clear table data
现在股票开户用什么app最安全?知道的给说一下吧
Using Sphinx to automatically generate API documents from py source files
Two advanced playing methods of QT signal and slot