SlideShare a Scribd company logo
Operators in C/C++
https://www.youtube.com/channel/UCN7YHR_k5EfZyLRm5r_NTUg
https://facebook.com/malayalamcasts
Operator & Operands
‱ Operators are the special kinds of symbols (or function like words
(sizeof)) that are used to perform any specific task like
mathematical and logical.
‱ Operands are the values (variables, symbols, functions) in which
an operand acts upon.
Operators in C/C++
‱ Arithmetic operators
‱ Relational operators
‱ Logical operators
‱ Bitwise operators
‱ Assignment operators
‱ Conditional operators
‱ Special operators
Arithmetic operators
Operator Description
+ adds two operands
- subtract second operands from first
* multiply two operand
/ divide numerator by denominator
% remainder of division
++ Increment operator - increases integer value by one
-- Decrement operator - decreases integer value by one
Relational Operators
Operator Description
== Check if two operand are equal
!= Check if two operand are not equal.
> Check if operand on the left is greater than operand on the right
< Check operand on the left is smaller than right operand
>= check left operand is greater than or equal to right operand
<= Check if operand on left is smaller than or equal to right operand
Logical Operators
Operator Description Example (a = true, b=false)
&& Logical AND (a && b) is false
|| Logical OR (a || b) is true
! Logical NOT (!a) is false
Bitwise operators
Operator Description
& Bitwise AND
| Bitwise OR
^ Bitwise exclusive OR
<< left shift
>> right shift
Assignment operators
Operator Description Example
= assigns values from right side operands to left
side operand
a=b
+= adds right operand to the left operand and
assign the result to left
a+=b is same as a=a+b
-= subtracts right operand from the left operand
and assign the result to left operand
a-=b is same as a=a-b
*= mutiply left operand with the right operand
and assign the result to left operand
a*=b is same as a=a*b
/= divides left operand with the right operand
and assign the result to left operand
a/=b is same as a=a/b
%= calculate modulus using two operands and
assign the result to left operand
a%=b is same as a=a%b
Conditional operators
‱ The conditional operators in C language are known by two more
names
‱ Ternary Operator
‱ ? : Operator
‱ Eg: expression 1 ? expression 2: expression 3
Special Operators
Operator Description Example
sizeof Returns the size of an
variable
sizeof(x) return size of the
variable x
& Returns the address of an
variable
&x ; return address of the
variable x
* Pointer to a variable *x ; will be pointer to a
variable x
Thank you
Like | Subscribe | Share

More Related Content

PPTX
Operator in c programming
PPTX
Operators and expressions in C++
PPT
Function overloading(c++)
PPTX
Unit 3. Input and Output
PPTX
Presentation on C Switch Case Statements
PPTX
Operators in java presentation
PDF
Object oriented programming c++
PPTX
Procedural programming
Operator in c programming
Operators and expressions in C++
Function overloading(c++)
Unit 3. Input and Output
Presentation on C Switch Case Statements
Operators in java presentation
Object oriented programming c++
Procedural programming

What's hot (20)

PPTX
Nesting of if else statement & Else If Ladder
PPTX
Data types in c++
PPTX
Control Flow Statements
PPTX
Data Types, Variables, and Operators
PPTX
Method overloading
PPT
CPU INPUT OUTPUT
PPSX
Algorithm and flowchart
PPT
Aggregate functions
PDF
Differences between c and c++
PPTX
Expression and Operartor In C Programming
PPTX
C vs c++
PPTX
JavaScript Conditional Statements
PPTX
PPTX
Programming Fundamentals lecture 1
PPTX
Operators in java
PPTX
Algorithm and flowchart
PPTX
Types of Programming Errors
PPT
2. operators in c
PPTX
Arithmetic Expression
PPT
Method overriding
Nesting of if else statement & Else If Ladder
Data types in c++
Control Flow Statements
Data Types, Variables, and Operators
Method overloading
CPU INPUT OUTPUT
Algorithm and flowchart
Aggregate functions
Differences between c and c++
Expression and Operartor In C Programming
C vs c++
JavaScript Conditional Statements
Programming Fundamentals lecture 1
Operators in java
Algorithm and flowchart
Types of Programming Errors
2. operators in c
Arithmetic Expression
Method overriding
Ad

Similar to Operators in C/C++ (20)

PPTX
Operators in Python
PPTX
Operators and it's type
PDF
itft-Operators in java
PPTX
11operator in c#
PDF
SPL 6 | Operators in C
PPTX
Session03 operators
PPTX
Operators and Expressions
PPTX
Python notes for students to develop and learn
PPTX
Logical Operators C/C++ language Programming
PDF
Java basic operators
PDF
Java basic operators
PDF
Operators in python
PDF
C++ notes.pdf BASIC C++ NOTES FOR BEGGINERS
PPTX
OPERATORS OF C++
PDF
C# Fundamentals - Basics of OOPS - Part 2
PPTX
Python programming language introduction unit
PPTX
Opeartor &amp; expression
PPTX
Operator 04 (js)
PDF
Coper in C
Operators in Python
Operators and it's type
itft-Operators in java
11operator in c#
SPL 6 | Operators in C
Session03 operators
Operators and Expressions
Python notes for students to develop and learn
Logical Operators C/C++ language Programming
Java basic operators
Java basic operators
Operators in python
C++ notes.pdf BASIC C++ NOTES FOR BEGGINERS
OPERATORS OF C++
C# Fundamentals - Basics of OOPS - Part 2
Python programming language introduction unit
Opeartor &amp; expression
Operator 04 (js)
Coper in C
Ad

Recently uploaded (20)

PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Essential Infomation Tech presentation.pptx
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
System and Network Administration Chapter 2
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
top salesforce developer skills in 2025.pdf
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
history of c programming in notes for students .pptx
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Transform Your Business with a Software ERP System
PPTX
ai tools demonstartion for schools and inter college
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Essential Infomation Tech presentation.pptx
2025 Textile ERP Trends: SAP, Odoo & Oracle
Design an Analysis of Algorithms I-SECS-1021-03
Design an Analysis of Algorithms II-SECS-1021-03
System and Network Administration Chapter 2
Odoo Companies in India – Driving Business Transformation.pdf
PTS Company Brochure 2025 (1).pdf.......
Navsoft: AI-Powered Business Solutions & Custom Software Development
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
How to Choose the Right IT Partner for Your Business in Malaysia
top salesforce developer skills in 2025.pdf
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Upgrade and Innovation Strategies for SAP ERP Customers
history of c programming in notes for students .pptx
Understanding Forklifts - TECH EHS Solution
Odoo POS Development Services by CandidRoot Solutions
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Transform Your Business with a Software ERP System
ai tools demonstartion for schools and inter college

Operators in C/C++

  • 2. Operator & Operands ‱ Operators are the special kinds of symbols (or function like words (sizeof)) that are used to perform any specific task like mathematical and logical. ‱ Operands are the values (variables, symbols, functions) in which an operand acts upon.
  • 3. Operators in C/C++ ‱ Arithmetic operators ‱ Relational operators ‱ Logical operators ‱ Bitwise operators ‱ Assignment operators ‱ Conditional operators ‱ Special operators
  • 4. Arithmetic operators Operator Description + adds two operands - subtract second operands from first * multiply two operand / divide numerator by denominator % remainder of division ++ Increment operator - increases integer value by one -- Decrement operator - decreases integer value by one
  • 5. Relational Operators Operator Description == Check if two operand are equal != Check if two operand are not equal. > Check if operand on the left is greater than operand on the right < Check operand on the left is smaller than right operand >= check left operand is greater than or equal to right operand <= Check if operand on left is smaller than or equal to right operand
  • 6. Logical Operators Operator Description Example (a = true, b=false) && Logical AND (a && b) is false || Logical OR (a || b) is true ! Logical NOT (!a) is false
  • 7. Bitwise operators Operator Description & Bitwise AND | Bitwise OR ^ Bitwise exclusive OR << left shift >> right shift
  • 8. Assignment operators Operator Description Example = assigns values from right side operands to left side operand a=b += adds right operand to the left operand and assign the result to left a+=b is same as a=a+b -= subtracts right operand from the left operand and assign the result to left operand a-=b is same as a=a-b *= mutiply left operand with the right operand and assign the result to left operand a*=b is same as a=a*b /= divides left operand with the right operand and assign the result to left operand a/=b is same as a=a/b %= calculate modulus using two operands and assign the result to left operand a%=b is same as a=a%b
  • 9. Conditional operators ‱ The conditional operators in C language are known by two more names ‱ Ternary Operator ‱ ? : Operator ‱ Eg: expression 1 ? expression 2: expression 3
  • 10. Special Operators Operator Description Example sizeof Returns the size of an variable sizeof(x) return size of the variable x & Returns the address of an variable &x ; return address of the variable x * Pointer to a variable *x ; will be pointer to a variable x
  • 11. Thank you Like | Subscribe | Share