当前位置:网站首页>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
边栏推荐
- 15 -- 最接近原点的 K 个点
- [untitled]
- Arithmetic operations and expressions
- [untitled] the CMD command window displays' NPM 'which is not an internal or external command
- 如何裁剪动图大小?试试这个在线照片裁剪工具
- Why should the coroutine be set to non blocking IO
- Luogu p5707 [deep foundation 2. example 12] late for school
- Review of arrays and pointers triggered by a topic
- Design and implementation of thread pool
- Biscuit distribution
猜你喜欢

What moment makes you think there is a bug in the world?

【Try to Hack】vulhub靶场搭建

New good friend Pinia, leading the new era of state management
![[untitled]](/img/7f/e2c9fbfb5eb6e7fcc6e23a46540933.jpg)
[untitled]

Jaspersoft studio installation

Use Matplotlib to draw a line chart

JS select all exercise

【Try to Hack】vulnhub DC1

Build a minimalist gb28181 gatekeeper and gateway server, establish AI reasoning and 3D service scenarios, and then open source code (I)

Ideal L9 in the eyes of the post-90s: the simplest product philosophy, creating the most popular products
随机推荐
15 -- k points closest to the origin
Daily question, magic square simulation
QT database connection deletion
JS recursion and while
挖财是正规的吗?股票开户安全吗?
@Font face fonts only work on their own domain - @font-face fonts only work on their own domain
分饼干问题
Time stamp calculation and audio-visual synchronization of TS stream combined video by ffmpeg protocol concat
Ideal L9 in the eyes of the post-90s: the simplest product philosophy, creating the most popular products
Character encoding minutes
BM setup process
Why should the coroutine be set to non blocking IO
JS to verify whether the string is a regular expression
Arithmetic operations and expressions
Vs2019 scanf error
Qlogsystem log system configuration use
Review of arrays and pointers triggered by a topic
JS capture, target, bubble phase
Luogu p5707 [deep foundation 2. example 12] late for school
Using Sphinx to automatically generate API documents from py source files