Top 4 Operators in C Language with Examples
Operator in C programming is a symbol use to perform some operation on variables, operands or with the constant. Some operator required 2 operand to perform operation or Some required single operation. Several operators are there those are, arithmetic operator, assignment, increment , decrement, logical, conditional, comma, size of , bitwise and others.
In this article, I will be sharing different types of Operator in C with examples.
Types of Operators in C Language
An operator is a symbol that tells the compiler to perform certain mathematical or logical manipulations.
C operators can be classified as
1. Arithmetic operators
2. Relational operators
3. Logical operators
4. Assignment operators
5. Increment or Decrement operators
6. Conditional operator
7. Bit wise operators
8. Special operators
ARITHMETIC OPERATORS IN C
All basic arithmetic operators are present in C.
- + add
- - subtract
- * multiplication
- / division
- % modulo division(remainder)
An arithmetic operation involving only real operands(or integer operands) is called real arithmetic(or integer arithmetic). If a combination of arithmetic and real is called mixed mode arithmetic.
RELATIONAL OPERATORS
We often compare two quantities and depending on their relation take certain decisions for that comparison we use relational operators.
- < is less than
- > is greater than
- <= is less than or equal to
- >= is greater than or equal to
- == is equal to
- != is not equal to
LOGICAL OPERATORS
- a.(a>=b) || (b>20)
- b.(b>a) && (e>b)
- c. 0(b!=7)
ASSIGNMENT OPERATORS
- int x= y;
- int Sum=x+y+z;
Check more posts on Programming and Information related to Coding only at Copy2Run Programs
Thanks for Visiting – Stay Updated with our Site and keep Visiting.
Comments
Post a Comment