c语言逻辑运算符(C language logical operator)
c语言逻辑运算符(C language logical operator)
C language operator
Arithmetic operator
TAG: operator, data type
TEXT: arithmetic operators perform arithmetic operations on numbers, including: add, subtract, multiply, divide, and find odd numbers, which are binocular operations. The results can be integers, single precision real numbers and double precision real numbers. Self increasing and subtracting operations are single operations, and their operands can only make integer variables, not constants or expressions.
REF:.TXT,.Txt - + operator,.Txt operator,.Txt operator,.Txt operator, *, /,% + + operator, operator, operator
Add +
TAG: arithmetic operators, operators, data types
TEXT: binocular operator, arithmetic addition. A unary operator that represents a positive number.
REF:.TXT, arithmetic operator.Txt
- reduction
TAG: arithmetic operators, operators, data types
TEXT: binocular operator, arithmetic subtraction. A unary operator that represents a negative number.
REF:.TXT, arithmetic operator.Txt
Take *
TAG: arithmetic operators, operators, data types
TEXT:*, binocular operators, arithmetic multiplication.
REF:.TXT, arithmetic operator.Txt
In addition to /
TAG: arithmetic operators, operators, data types
TEXT:/, operator, count division; if two participated in the operation number is an integer divisible by rounding decimal representation.
Such as 5.0/2 equals 2.5, and 5/2 equals 2.
REF:.TXT, arithmetic operator.Txt
Take out%
TAG: arithmetic operators, operators, data types
TEXT:/, operator, count division; if two participated in the operation number is an integer divisible by rounding decimal
representation.
Such as 5.0/2 equals 2.5, and 5/2 equals 2.
REF:.TXT, arithmetic operator.Txt
Self Plus + +
TAG: arithmetic operators, operators, data types
TEXT: unary operator, for integer operations, can be placed on both sides of the operand, that the number of operations increased by 1.
REF:.TXT, arithmetic operator.Txt
Self subtraction -
TAG: arithmetic operators, operators, data types
TEXT: unary operator, for integer operations, can be placed on both sides of the operand, representing the number of operations minus 1.
REF:.TXT, arithmetic operator.Txt
Relational operator
TAG: arithmetic operators, operators, data types
TEXT: operator is used to compare the two operands (greater
than), including: > <, > = (less than) (greater than or equal to), (less than) < =,! = (non equal), = = (equal).
The relationship between expression by relational operators (<, >, > =, < =,! =, = =) expression of connected structure, relational operators in the "relationship" two word refers to the meaning of a data and another data relationship, this relationship was not only set up with two possible conditions in the C language used to represent logical values, true and false logically with the number "1" and "0" to indicate the. When the relation is established, the result of the expression is true (1), otherwise the result of the expression is false (0).
REF:.TXT,.Txt > > = operator,.Txt operator,.Txt operator,.Txt operator < < =, = = = operator, operator!
>
TAG: relational operators, operators, data types
The TEXT:> operator, such as a>b, returns the value 1 (logical truth) if the value of a is greater than B, or else returns the value 0 (logical false).
REF:.TXT, relational operator.Txt
Less than <
TAG: relational operators, operators, data types
The TEXT:> operator, such as a>b, returns the value 1 (logical truth) if the value of a is greater than b,
The type of each operand can be any type of expression (including any type of constant, variable, and return value for any type of function call).
General form:
< expression 1>? < expression, 2>:< expression, 3>
The calculation process is to calculate the value of 1> < expression, if true (0), the calculation of < expression of 2> value, and the expression of 2> "as the value of the conditional expression results; if false (0), the calculation of < expression of 3> value, and the value of 3> expression" as the conditional expression value. That is, depending on the truth / false of the condition, the result of an expression can only be chosen as the result of the entire expression.
Priority: higher than the assignment operator, lower than the logical relational operator.
For example, a>b, x=3, x=5; if a>b, then the value of X is 3, and vice versa is 5.
REF:.TXT,
Comma Operator
TAG: operator, data type
TEXT: comma expressions are joined by more than two expressions by the comma operator. The result is the result of the last expression. Comma expressions can be of any type.
General form:
< expression 1>, < expression 2>, < < expression n> > >
The calculation process: sequentially calculates the value of < expression 1>, and the value of < expression 2>,... < < the value of expression n> >, and finally, the value of < expression n> is the result of the whole expression. Therefore, comma expressions are also called sequential evaluation operations".
Priority: lowest in all operators.
Bonding direction: from left to right (left associativity)
For example: int, a=2, c;
Float b=5.2;
C=a, 2*a, 2*b was 10.4 (the value of the last expression), because the order of evaluation of a comma expression is: first, calculate c=a, a value is assigned to C (c=2), the calculation of the value of 2*a (4), and finally calculate the value of 2*b (10.4). When the entire expression is finished, the value of C is 2, and the value of the entire expression is 10.4.
REF:.TXT,
B
Sizeof operator
TAG: operator, data type
TEXT:sizeof C language is a unary operator, such as C + + language, other operators -- etc.. It is not a function. The sizeof operator gives the storage size of its operands in bytes. Operands can be either an expression or a type name enclosed in parentheses. The storage size of operands is determined by the type of operand.
REF:.TXT,
Type conversion
Implicit transformation
Explicit conversion
Bitwise Operators
TAG: operator, data type
TEXT: in C, the bit operator is a bit operation designed to describe the system, and its design goal is to replace assembly language. Bit arithmetic is to test or shift bits of bytes or words in the word (bit). Operator is the operation of character (char) or integer (int) data in the C language and not for other
types. For example: float, double and so on. Bit operators are divided into bit logic operators and shift operators.
REF:.TXT &.Txt operator,.Txt operator,.Txt operator, |, ^.Txt
Bit logic and
TAG: logical operators, arithmetic operators, operators, data types
TEXT:& logic and operators, bitwise and.
If the binary number of 2 is 0010, the binary number of 7 is 0111
The value of 2&7 is 2 (0010).
REF:.TXT, logical operator.Txt
Bit logic or
TAG: logical operators, arithmetic operators, operators, data types
TEXT:| logic and operator, bitwise, or.
If the binary number of 2 is 0010, the binary number of 7 is 0111
The value of 2|7 is 7 (0111).
REF:.TXT,
Logical operator.Txt
Bit logic inversion
TAG: logical operators, arithmetic operators, operators, data types
TEXT: logic and operators, unary operators, right combination, the number of arithmetic bits against.
REF:.TXT, logical operator.Txt
Bit logic XOR
TAG: logical operators, arithmetic operators, operators, data types
TEXT:^ logic and operator, bitwise XOR (bit dissimilarity is, or else 0).
If the binary number of 2 is 0010, the binary number of 7 is 0111
The value of 2^7 is 5 (0101).
REF:.TXT, logical operator.Txt
本文档为【c语言逻辑运算符(C language logical operator)】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。