c语言英语解释,c语言运算符的详细讲解(国外英语资料).doc

本文详细解读了C语言中的赋值运算符和算术运算符,包括等号='':赋值原理,从右向左的运算顺序,以及如何使用加减乘除和取余操作。通过实例演示了如何在表达式中运用这些运算符。同时介绍了优先级和括号在运算中的作用,以及常见的问题如表达式错误和单双目运算符的区分。
摘要由CSDN通过智能技术生成

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 it's going to be total2 = 0; Then total1 total2 =; So can we do that?

= (total1 total2) = 0;

That's not ok, because we're going to start with the inside of the parentheses, where total1 = total2 is an expression, and the left side of the assignment statement doesn't 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. It's 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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值