SlideShare a Scribd company logo
What is an Operator?
Operator is a symbol that indicates the compiler to perform some
specific mathematical or logical function. There are a variety of
operators in C language.
sum = a + b;
Operand
Operator
There are variety of operators in C Language :-
1- Arithmetic Operator
2- Increment Decrement Operator
3- Assignment Operator
4- Relational Operator
5- Logical Operator
6- Bitwise Operator
7- Special Operator or Miscellaneous Operator
Arithmetic Operator
This operator is used to perform mathematical operations such as multiplication,
division, addition, subtraction on the numerical values.
Operator Operation Example
+
-
*
/
%
Addition of operands
Subtraction of operands
Multiplication of operands
Division of operands
It return remainder
3 + 2 = 5
3 - 2 = 1
3 * 2 = 6
6 / 2 = 3
10 % 2 = 0
Increment decrement Operator
There are two operations in C programming ++ and – called as Increment and
decrement operators, it used to increase the cause by one and decrease the
value by one.
Operator Operation Example(a=10)
++
--
Increments the value by one
Decrements the value by one
a++ //11
a-- //9
Assignment Operator
This operator is used to assign the value to the variable, = is most common of all
the assignment operator.
Operator Example Same as
=
+=
*=
/=
%=
a=5 a = 5
a = a+5
a = a*5
a = a/5
a = a% 5
a+=5
a*=5
a/=5
a%=5
Relational Operator
It is used to check the relation between the two operands, if the relation is true
it returns 1 if the relation is false it returns 0.
Operator Meaning of Operator Example
==
!=
>
<
>=
Check if two operand are equal 5==5 //1
5>3 //1
5<3 //0
5>=5 //1
if two operand are not equal
if operand on the left is greater than operand on the right
operand on the left is smaller than right operand
if operand on left is smaller than or equal to right operand
5!=2 //1
Logical Operator
The expression containing this logical operator returns 0 or 1 depending upon
result is true or false. It is generally used with decision making.
Operator Meaning of Operator Example (a=2, b=5)
||
!
Returns true if all are true ((a==2) && (b==5)) //True
Returns true if any one is true
Returns true when value is false
&&
((a==2) || (b>7)) //True
!(a==2) //False
Bitwise Operator
When we use this operator the mathematical or computation operation we are
doing is converted to bit level first to make the processing faster and saves
power.
a
0
0
1
1
b
1
0
1
0
a & b
0
0
1
0
a | b
1
0
1
1
a ^ b
1
0
0
1
Bitwise Operator
Left shift
a = 00010000
b=2
a<<b
01000000
Right shift
a = 00010000
b=2
a>>b
00000100
Special Operators
Operator Meaning of Operator Example (a=2, b=5)
&
*
Returns size of variable Int a; sizeof(a) //2
Returns address of the variable
Points to address of another variable
sizeof()
Int a; &a //address
int *ptr
, Used as separator and operator both a=(3,5,4) //4
Comma Operator
int a=10, b=20, c=50; //separator
int a = (5,10,18); //operator
Output  18
Because comma operator takes the rightmost value, it
evaluates all values but rejects them.
int a = 5,10,18 ; //error
int a = 5, int 10, int 18 ; //error
Let’s see Special Operators in Turbo C

More Related Content

PPTX
Python operators
PPTX
Operators in C & C++ Language
PPT
2. operators in c
PDF
Coper in C
ODP
Operators
PPTX
C Operators
PPTX
Operators and it's type
Python operators
Operators in C & C++ Language
2. operators in c
Coper in C
Operators
C Operators
Operators and it's type

What's hot (19)

PPT
Arithmetic operator
PPTX
Operators in C/C++
PPTX
Oop using JAVA
PPTX
Python Programming | JNTUK | UNIT 1 | Lecture 5
PPT
Basic c operators
PPT
CBSE Class XI :- Operators in C++
PPTX
Operators in c++
PPT
Operation and expression in c++
PDF
Operators in c
PPTX
PPT
2 1 expressions
PPTX
Operator
PPTX
PPTX
Mathematical and logical operators
PPTX
Operators and expressions
PPTX
Opreator In "C"
PPT
C Prog. - Operators and Expressions
PPTX
Matlab operators
PPTX
Operators and expressions in C++
Arithmetic operator
Operators in C/C++
Oop using JAVA
Python Programming | JNTUK | UNIT 1 | Lecture 5
Basic c operators
CBSE Class XI :- Operators in C++
Operators in c++
Operation and expression in c++
Operators in c
2 1 expressions
Operator
Mathematical and logical operators
Operators and expressions
Opreator In "C"
C Prog. - Operators and Expressions
Matlab operators
Operators and expressions in C++
Ad

Similar to What are operators? (20)

PPTX
operator (1).pptx
PDF
Types of Operators in C programming .pdf
PPTX
3. C_OperatorsExpressions on c languyage.pptx
PPTX
C language operator
PPTX
operators.pptx
PPT
C operators ppt
PPTX
OPERATORS OF C++
PPTX
Operators in C
PPTX
Arithmetic and increment decrement Operator
PPTX
C operators
PDF
Unit ii chapter 1 operator and expressions in c
PDF
C Operators and Control Structures.pdf
PPTX
Operator in c programming
PPTX
Operator.ppt
PPT
Operators in c language
PPTX
operatorsincprogramming-190221094522.pptx
PPTX
C language operators
PPTX
Cse lecture-4.1-c operators and expression
PPTX
C operators
PPTX
Operators in c by anupam
operator (1).pptx
Types of Operators in C programming .pdf
3. C_OperatorsExpressions on c languyage.pptx
C language operator
operators.pptx
C operators ppt
OPERATORS OF C++
Operators in C
Arithmetic and increment decrement Operator
C operators
Unit ii chapter 1 operator and expressions in c
C Operators and Control Structures.pdf
Operator in c programming
Operator.ppt
Operators in c language
operatorsincprogramming-190221094522.pptx
C language operators
Cse lecture-4.1-c operators and expression
C operators
Operators in c by anupam
Ad

More from AnuragSrivastava272 (13)

PPTX
What is recursion?
PPTX
What is Do while loop?
PPTX
What is while loop?
PPTX
What is loops? What is For loop?
PPTX
What is Switch Case?
PPTX
What are conditional statements?
PPTX
What is Non-primitive data type?
PPTX
What is Data Types and Functions?
PPTX
What is Variables and Header files
PPTX
What is IDE?
PPTX
What is Platform Dependency?
PPTX
What is Computer Language?
PPTX
What is Language?
What is recursion?
What is Do while loop?
What is while loop?
What is loops? What is For loop?
What is Switch Case?
What are conditional statements?
What is Non-primitive data type?
What is Data Types and Functions?
What is Variables and Header files
What is IDE?
What is Platform Dependency?
What is Computer Language?
What is Language?

Recently uploaded (20)

PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
master seminar digital applications in india
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Complications of Minimal Access Surgery at WLH
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Institutional Correction lecture only . . .
PDF
Classroom Observation Tools for Teachers
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Pre independence Education in Inndia.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Pharma ospi slides which help in ospi learning
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
master seminar digital applications in india
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Complications of Minimal Access Surgery at WLH
PPH.pptx obstetrics and gynecology in nursing
Computing-Curriculum for Schools in Ghana
Institutional Correction lecture only . . .
Classroom Observation Tools for Teachers
O7-L3 Supply Chain Operations - ICLT Program
human mycosis Human fungal infections are called human mycosis..pptx
Final Presentation General Medicine 03-08-2024.pptx
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Supply Chain Operations Speaking Notes -ICLT Program
Basic Mud Logging Guide for educational purpose
Renaissance Architecture: A Journey from Faith to Humanism
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Pre independence Education in Inndia.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Pharma ospi slides which help in ospi learning

What are operators?

  • 1. What is an Operator?
  • 2. Operator is a symbol that indicates the compiler to perform some specific mathematical or logical function. There are a variety of operators in C language. sum = a + b; Operand Operator
  • 3. There are variety of operators in C Language :- 1- Arithmetic Operator 2- Increment Decrement Operator 3- Assignment Operator 4- Relational Operator 5- Logical Operator 6- Bitwise Operator 7- Special Operator or Miscellaneous Operator
  • 4. Arithmetic Operator This operator is used to perform mathematical operations such as multiplication, division, addition, subtraction on the numerical values. Operator Operation Example + - * / % Addition of operands Subtraction of operands Multiplication of operands Division of operands It return remainder 3 + 2 = 5 3 - 2 = 1 3 * 2 = 6 6 / 2 = 3 10 % 2 = 0
  • 5. Increment decrement Operator There are two operations in C programming ++ and – called as Increment and decrement operators, it used to increase the cause by one and decrease the value by one. Operator Operation Example(a=10) ++ -- Increments the value by one Decrements the value by one a++ //11 a-- //9
  • 6. Assignment Operator This operator is used to assign the value to the variable, = is most common of all the assignment operator. Operator Example Same as = += *= /= %= a=5 a = 5 a = a+5 a = a*5 a = a/5 a = a% 5 a+=5 a*=5 a/=5 a%=5
  • 7. Relational Operator It is used to check the relation between the two operands, if the relation is true it returns 1 if the relation is false it returns 0. Operator Meaning of Operator Example == != > < >= Check if two operand are equal 5==5 //1 5>3 //1 5<3 //0 5>=5 //1 if two operand are not equal if operand on the left is greater than operand on the right operand on the left is smaller than right operand if operand on left is smaller than or equal to right operand 5!=2 //1
  • 8. Logical Operator The expression containing this logical operator returns 0 or 1 depending upon result is true or false. It is generally used with decision making. Operator Meaning of Operator Example (a=2, b=5) || ! Returns true if all are true ((a==2) && (b==5)) //True Returns true if any one is true Returns true when value is false && ((a==2) || (b>7)) //True !(a==2) //False
  • 9. Bitwise Operator When we use this operator the mathematical or computation operation we are doing is converted to bit level first to make the processing faster and saves power. a 0 0 1 1 b 1 0 1 0 a & b 0 0 1 0 a | b 1 0 1 1 a ^ b 1 0 0 1
  • 10. Bitwise Operator Left shift a = 00010000 b=2 a<<b 01000000 Right shift a = 00010000 b=2 a>>b 00000100
  • 11. Special Operators Operator Meaning of Operator Example (a=2, b=5) & * Returns size of variable Int a; sizeof(a) //2 Returns address of the variable Points to address of another variable sizeof() Int a; &a //address int *ptr , Used as separator and operator both a=(3,5,4) //4
  • 12. Comma Operator int a=10, b=20, c=50; //separator int a = (5,10,18); //operator Output  18 Because comma operator takes the rightmost value, it evaluates all values but rejects them. int a = 5,10,18 ; //error int a = 5, int 10, int 18 ; //error
  • 13. Let’s see Special Operators in Turbo C