70 likes | 152 Views
There are various operators in the c programming language, if you know about the basics of c language and want to know more about c programming then visit here our c operator tutorial. For further more information visit here<br>https://www.phptpoint.com/c-programming-language-tutorial/
E N D
C Operators C language includes a rich set of integrated operators. An operator is a symbol used to perform a certain application of mathematics or logic. Operators are used in C programming language to manipulate the data and variables in applications and are part of mathematical or logical expressions. In other terms, we may say the operands are handled by an operator. There are major types of operators in C: ● Arithmetic Operators ● Relational Operators ● Logical Operators ● Bitwise Operators ● Assignment Operators ● Conditional Operators
These are operators, we know in thisc tutorial 1. Arithmetic operators Both simple arithmetic operators are provided by C. The table below shows all of the essential arithmetic operators. Operator Description + adds two operands - subtract second operands from first * multiply two operand / divide numerator by the denominator % remainder of division ++ Increment operator - increases integer value by one -- Decrement operator - decreases integer value by one
2. Relational operators The table below lists all C assisted Partnership Operators. Operator Description == Check if two operands are equal != Check if two operands are not equal. > Check if the operand on the left is greater than operand on the right < Check operand on the left is smaller than the right operand >= check left operand is greater than or equal to the right operand <= Check if the operand on left is smaller than or equal to the right operand 3.Logical operators C language supports 3 logical operators. Assume a = 1 and b = 0,
Operator Description Example && Logical AND (a && b) is false || Logical OR (a || b) is true ! Logical NOT (!a) is false 4.Bitwise operators Bitwise operators perform Bit Level Data Manipulation. Such operators also do bits change from right to left. Bitwise operators are not used for floating or duplicating. Operator Description & Bitwise AND | Bitwise OR ^ Bitwise exclusive OR
<< left shift >> right shift 5. Assignment Operators Operator Description Example = a=b Assigns values from right operand to left-hand += Attach right operand to left operand and assign a+=b is same as a=a+b the result to left operand -= Subtracts operand right from operand left and a-=b is same as a=a-b assigns the output to operand left *= Multiply the left operand and assign the output to a*=b is same as a=a*b the left operand /= Divide left operand with right operand and assign a/=b is same as a=a/b left operand to the result
Calculate the modulus using two operands and operand result %= a%=b is same as a=a%b assign the left Conditional Operators The C-language conditional operators are identified by two more names 1. Ternary Operator 2. ?: Operator It is basically the if condition that we use in C language decision-taking, but we transform the if condition expression into a short and easy operator with conditional operators. The syntax of a conditional operator is : expression 1? expression 2: expression 3 Original source