c语言 operator,c语言入门教程c语言中的运算符(C language tutorial C language operator).doc...

c语言入门教程c语言中的运算符(C language tutorial C language operator)

c语言入门教程c语言中的运算符(C language tutorial C language operator)

The operator in C language as the basic part, used in programming every hour and moment: for example, no longer need to use the variable assignment assignment operators, two the number of operations needed and compare the size of the operator, the related knowledge of this chapter "C language tutorial" will take you to the learning operator.

I. C language tutorial, assignment operator

The function of an assignment statement is to assign the value of a constant or variable or expression to another variable. The symbol is' ='. Here is not equal to the mean, just equal to the assignment, '= =' represents.

Note: the variables to the left of the assignment statement must be declared elsewhere.

We have assigned variables as an lvalue, because they appear on the left side of an assignment statement; value expressions we called rvalue, because she they appear in the assignment of the right. Only constant as an rvalue.

Such as:

Count=5;

Total1=total2=0;

The first assignment statement is understandable to everyone.

The second assignment statement means assigning 0 to two variables at the same time. This is because the assignment statement is calculated from right to left, that is to say, from the right end. So it's total2=0 first; then total1=total2; then, can we do this?

(total1=total2) =0;

This is not possible, because the parentheses are first computed, then total1=total2 is an expression, and the left side of the assignment statement is not allowed to exist.

Two, C language introductory tutorial, arithmetic operators

In the C language, there are two monocular and five binocular operators.

Symbolic function

Single eye right

Monocular negative

* multiplication

Divide

% modulo

Addition

Subtraction

Here are some examples of assignment statements that use the arithmetic operators above in the expression to the right of the assignment operator:

Area=Height*Width;

Num=num1+num2/num3-num4;

The operator also has a problem fo

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值