SANDIP FOUNDATION’S
Sandip Institute of Technology & Research
Centre, Nashik An Autonomous Institute
DIV :- J
Permanently Affiliated To SPPU, Department of
Engg. Sciences & Humanities
PPT Presentation by
F.Y.B.Tech Students
A.Y. : 2024-2025
Roll No :- Name of Students :-
1031 Lokhande Bhagyashri Sahebrao
1032 Thakare Prathamesh Anil
1033 Sangale Suvarna Dadaji
1034 Pawar Priyanjali Sanjay
1035 Bachhav Chetan Dipak
Guided By :-
-
Operators in C
Programming
Understanding the Building Blocks of C Programming
Introduction to Operators
What are Operators? Why are they Essential?
Operators are symbols that perform specific operations Operators are fundamental to C programming, enabling
on operands (values or variables) to produce a result. you to perform calculations, comparisons, and
manipulations of data.
Types of Operators
Arithmetic Operators Relational Operators Logical Operators
Perform mathematical operations Compare values and return true Combine logical expressions to
like addition, subtraction, or false based on their create complex conditions using
multiplication, division, and relationship (greater than, less AND, OR, and NOT.
modulus. than, etc.).
Bitwise Operators Assignment Operators
Perform operations directly on individual bits of data, Assign values to variables or modify their values
used for efficient data manipulation. with operators like =, +=, -=, etc.
Arithmetic Operators
Addition Subtraction Multiplication Division
Adds two operands. Subtracts the second Multiplies two operands. Divides the first operand
Example: a + b. operand from the first. Example: a * b. by the second. Example: a
Example: a - b. / b.
Modulus
Returns the remainder
after integer division.
Example: a % b.
Examples and Visuals
10 20 30
Addition Subtraction Multiplication
x = 5 + 3; // x = 8 y = 10 - 4; // y = 6 z = 7 * 2; // z = 14
40 5
Division Modulus
a = 25 / 5; // a = 5 b = 17 % 3; // b = 2
Relational Operators
== (Equal to)
Checks if two operands are equal. Example: a == b.
!= (Not Equal to)
Checks if two operands are not equal. Example: a != b.
> (Greater than)
Checks if the first operand is greater than the second. Example: a > b.
< (Less than)
Checks if the first operand is less than the second. Example: a < b.
>= (Greater than or equal to)
Checks if the first operand is greater than or equal to the second. Example: a >= b.
<= (Less than or equal to)
Checks if the first operand is less than or equal to the second. Example: a <= b.
Logical Operators
&& (Logical AND)
1 Returns true if both operands are true. Example: a && b.
|| (Logical OR)
2
Returns true if at least one operand is true. Example: a || b.
! (Logical NOT)
3
Reverses the logical state of the operand. Example: !a.
Bitwise Operators
& (Bitwise AND)
1
Performs a bit-by-bit AND operation on operands. Example: a & b.
| (Bitwise OR)
2
Performs a bit-by-bit OR operation on operands. Example: a | b.
^ (Bitwise XOR)
3
Performs a bit-by-bit XOR operation on operands. Example: a ^ b.
~ (Bitwise NOT)
4
Inverts the bits of the operand. Example: ~a.
<
5 Left shifts the bits of the first operand by the number of positions specified by the second
operand. Example: a << b.
> (Right shift)
6 Right shifts the bits of the first operand by the number of positions specified by
the second operand. Example: a >> b.
Assignment Operators
Simple Assignment (=) Compound Assignment
Assigns the value of the right operand to the left Combines an arithmetic operation with an assignment.
operand. Example: a = b. Example: a += b (equivalent to a = a + b).
Operator Precedence and
Associativity
Operators have a hierarchy of precedence, determining the order
of operations. For example, multiplication and division have higher
precedence than addition and subtraction. Associativity determines
how operators of the same precedence are evaluated (left-to-right
or right-to-left).