This tutorial by Simplilearn will explain to you about Operators In C Programming. This Operators In C Programming tutorial will help you learn Arithmetic, Relational, Logical Operators In C, bitwise, and assignment operators in C. This C programming tutorial will cover both theoretical and practical demonstrations for a better learning experience on unary, binary, and ternary Operators in C.
6. Types of Operators in C
Types of Operators
Unary operator
Binary operator
Ternary operator
unary minus
Increment
decrement
Logical not
Arithmetic
Relational
Conditional
Logical
Bitwise
Assignment
8. Unary Operator
Unary operators Description Example (x=5, y=2)
- Unary minus y = -y
++ Increment x = ++y / x = y++
-- Decrement x = --y / x = y--
! Logical not !(x<=y)
10. Binary Operators
Arithmetic operators Description Example (x=5, y=2)
+ Addition x + y
- subtraction x – y
* multiplication x * y
/ Division x / y
% Modular x % y
11. Binary Operators
Relational operators Description Example (x=5, y=2)
> Greater than x > y
< Less than x < y
<= Less than or equal to x <= y
>=
Greater than or equal
to
x >= y
== Equal to x == y
!= Not equal to x != y
12. Binary Operators
Logical operators Description
Example (x=5, y=2,
z=3)
&& Logical AND x > y && x < z
|| Logical OR x < y || x > z
! Logical NOT !(x < y)
15. Binary Operators
Assignment
operators
Description Example (x=5, y=2)
= assignment X = 5
+= sum and assign x + = 2
-= Subtract and assign x - = 3
*= Multiply and assign x * = 2 or x = x*2
/= Divide and assign x / = 2 or x = x / 2
&=
Bitwise AND and
assign
x &= y
|= Bitwise OR and assign x != y