- 5
- 0
- 约5.42万字
- 约 14页
- 2017-06-26 发布于河南
- 举报
c语言运算符的详细讲解(国外英语资料)
c语言运算符的详细讲解(国外英语资料)
The assignment operator
The function of an assign statement is to assign values of a constant or variable or expression to another variable. The sign is = . And this is not the same thing as saying, just assigning the value, is equal to saying, = =.
Note: the variable on the left of the assignment statement must be declared elsewhere in the program.
The variables that have to be assigned are called left values because they appear on the left side of the assignment statement; The expression that produces a value is called the right value because she appears on the right side of the assignment statement. The constant can only be a right.
Such as:
The count = 5;
Total1 total2 = = 0;
The first assignment statement is understandable.
The second assignment statement means to assign 0 to both variables. This is because the assignment statement is from right to left, which is to start at the right. So its going to be total2 = 0; Then total1 total2 =; So can we do that?
= (total1 total2) = 0;
Thats not ok, because were going to start with the inside of the parentheses, where total1 = total2 is an expression, and the left side of the assignment statement doesnt allow the expression to exist.
Second, arithmetic operators
There are two single and five binocular operators in the C language.
Symbolic function
+ monocular is
- monocular negative
* the multiplication
/ division
% modulus
+ addition
- subtraction
Here are some examples of assignment statements that use the arithmetic operator in the right-hand side of the assignment operator:
Area = Height * Width;
Num = num1 + num2 / num3 - num4;
The operator also has an operational order problem, which is plus or minus. Its the first operation of a single order with a single one.
The fetch operator (%) is used to calculate the remainder of the two integers. Such as:
A = 7% 4;
And the result of a is 3, because the remainder of 7 is 3.
So someone asked, what do I do with their quotient?
B = 7/4.
So b is the quot
您可能关注的文档
最近下载
- 2026年相变材料在机械系统中的动态响应.pptx VIP
- 2025年浙江广厦建设职业技术大学辅导员考试真题.docx VIP
- 2026年春季学期中小学1530安全教育记录.docx VIP
- 2025年张家界航空工业职业技术学院单招笔试职业技能考核试题库含答案解析.docx VIP
- 《义务教育艺术课程标准(2022年版)》中美术课程标准的主要变化.docx VIP
- 人情面子与权力的再_生产.pdf VIP
- 2025中考真题--北京市中考数学试卷(含答案).docx
- 工程项目智慧管理 课件全套 模块1--8 工程项目智慧管理概述----工程项目智慧信息管理.pptx
- 管道桥架支架.xls VIP
- (必会)铁路机车车辆驾驶人员(J5类)近年考试真题题库资料(含答案).pdf VIP
原创力文档

文档评论(0)