SlideShare uma empresa Scribd logo
1 de 13
Contents
1. Introduction of operators.
2. Types of operator
3. Arithmetic operator
4. Relational operator
5. Logical operator
6. Bitwise operator
7. Assignment operator
8. Conditional operator
9. Special operator
10. Increment and decrement operator.
Introduction of operator :-
C language supports a rich set of built-in
operators.
An operator is a symbol that tells the compiler to
perform a certain mathematical or logical
manipulation.
Operators are used in programs to manipulate data
and variables .
Arithmetic operator:-
C support all the basic arithmetic operators. The
following table shows all the basic arithmetic operator.
Operator Description
+ Adds two operands
- Subtract second operands from first
* Multiply two operands
/ Divide numerator by denominator
% Remainder of devision
++ Increment operator –increases integer value
by one
-- Decrement operator – decreases integer value
by one
Relational operators
The following table shows all relation operator supported by C.
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 operands is greater than or
equal to right operands
<= Check if operand on the left is smaller
than or equal to right operand
Logical operators
C language supports following 3 logical operators .
Suppose (a =1 ) an ( b= 0)
Operator Description Example
&& Logical AND ( a&&b) is false
|| Logical OR ( a||b ) is true
! Logical NOT (!a) is false
Bitwise operators
Bitwise operators perform manipulation of data at bit level . These
operators also perform shifting of bits from right to left .
Bitwise operators are not applied to float or double.
Operator Description
& Bitwise AND
| Bitwise OR
^ Bitwise exclusive OR
<< Left shift
>> Right shift
Now lets see truth table for bitwise & , | and ^
The bitwise shifts operators shifts the bit value . The left
operand specifies the value to be shifted and the right operand
Specifies the number of position that the bits in the value have
to be shifted . Both operands have the same precedence.
a b a & b a | b a ^b
0 0 0 0 0
0 1 0 1 1
1 0 0 1 1
1 1 1 1 0
Assignment operator
Assignment operators supported by C language are as follows.
Operator Description Example
= Assigns values From right
side operands to left side
operands
a=b
+= Adds right operands to
the left operands and
assign the result to Left
a+=b is same as
a=a+b
-= Substrect right operands
from the left operand and
assigns the result to Left
operands
a -=b is same as
a = a – b
*= Mutiply left operand with
the right operand and
assigns the result to Left
operand
a*= b is same as
a = a*b
/ = Devides Left operand with
the right operand and
assign the result to left
operand.
a/=b is same as
a=a/b
%= Calculate modules assign
Two operands and assigns
the result to left operand
a%=b is same as
a=a%b
Conditional operattor
The conditional operators in C language are known by two
more names .
1 Ternary operator
2 ?: Operator
It is actually the if condition that we use in C language
decision making , but using conditional operator ,we turn the
if condition statement into a short and simple operator .
The Syntex of a conditional operator is :
Expression 1 ? Expression 2 : expression 3
Special operators
Operator Description Example
Size of Returns the size of an
variable
Size of (x) return size of
the variable X
& Returns the address of
an variable
& X ; will be pointer t
a varriable X
* Pointer to a varriable *X ; will be pointer to
varriable X
Incrementanddecrementoperator
Increament operators are used to increased the value of the varriable
by one and Decrement operators are used to decrease the value of
the varriable by one in C program .
Both increment and Decrement operator are used on a single open
and or variable , so it is called as a unary operator .
Unary operators are having higher priority that the other operators it
means unary operators are excuted before other operators.
Syntax ; [ ++ // Increment operator ]
[ -- // Decrement operator ]
Operators and it's type

Mais conteúdo relacionado

Mais procurados (20)

C Operators
C OperatorsC Operators
C Operators
 
Operators
OperatorsOperators
Operators
 
Programming C Part 02
Programming C Part 02Programming C Part 02
Programming C Part 02
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
R operators
R   operatorsR   operators
R operators
 
Python operators part2
Python operators part2Python operators part2
Python operators part2
 
Operators
OperatorsOperators
Operators
 
Operator in c programming
Operator in c programmingOperator in c programming
Operator in c programming
 
Operator.ppt
Operator.pptOperator.ppt
Operator.ppt
 
Opeartor &amp; expression
Opeartor &amp; expressionOpeartor &amp; expression
Opeartor &amp; expression
 
Operators
OperatorsOperators
Operators
 
Python : basic operators
Python : basic operatorsPython : basic operators
Python : basic operators
 
Conditional operators
Conditional operatorsConditional operators
Conditional operators
 
Precedence and associativity (Computer programming and utilization)
Precedence and associativity (Computer programming and utilization)Precedence and associativity (Computer programming and utilization)
Precedence and associativity (Computer programming and utilization)
 
Basic c operators
Basic c operatorsBasic c operators
Basic c operators
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
C++
C++ C++
C++
 
operators and expressions in c++
 operators and expressions in c++ operators and expressions in c++
operators and expressions in c++
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
 
Oop using JAVA
Oop using JAVAOop using JAVA
Oop using JAVA
 

Semelhante a Operators and it's type

Semelhante a Operators and it's type (20)

data type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de ladata type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de la
 
Types of Operators in C
Types of Operators in CTypes of Operators in C
Types of Operators in C
 
operator (1).pptx
operator (1).pptxoperator (1).pptx
operator (1).pptx
 
11operator in c#
11operator in c#11operator in c#
11operator in c#
 
Coper in C
Coper in CCoper in C
Coper in C
 
C language
C languageC language
C language
 
Cse lecture-4.1-c operators and expression
Cse lecture-4.1-c operators and expressionCse lecture-4.1-c operators and expression
Cse lecture-4.1-c operators and expression
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
 
itft-Operators in java
itft-Operators in javaitft-Operators in java
itft-Operators in java
 
C++ revision add on till now
C++ revision add on till nowC++ revision add on till now
C++ revision add on till now
 
C++ revision add on till now
C++ revision add on till nowC++ revision add on till now
C++ revision add on till now
 
Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Chapter 5 - Operators in C++
Chapter 5 - Operators in C++
 
Operators and Expressions
Operators and ExpressionsOperators and Expressions
Operators and Expressions
 
Session03 operators
Session03 operatorsSession03 operators
Session03 operators
 
C++ Expressions Notes
C++ Expressions NotesC++ Expressions Notes
C++ Expressions Notes
 
Programming presentation
Programming presentationProgramming presentation
Programming presentation
 
Theory3
Theory3Theory3
Theory3
 
Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++
 
C++ chapter 2
C++ chapter 2C++ chapter 2
C++ chapter 2
 

Mais de Asheesh kushwaha

Thermal engineering question bank
Thermal engineering question bankThermal engineering question bank
Thermal engineering question bankAsheesh kushwaha
 
Electro chemical machine ( ecm )
Electro chemical machine ( ecm ) Electro chemical machine ( ecm )
Electro chemical machine ( ecm ) Asheesh kushwaha
 
refrigeration system basic
refrigeration system  basicrefrigeration system  basic
refrigeration system basicAsheesh kushwaha
 
Exhaust gas recirculation ( egr) system
Exhaust gas recirculation  ( egr) system Exhaust gas recirculation  ( egr) system
Exhaust gas recirculation ( egr) system Asheesh kushwaha
 
Refrigeration handling and use of tool
Refrigeration handling  and use of toolRefrigeration handling  and use of tool
Refrigeration handling and use of toolAsheesh kushwaha
 
Automobile chessis experiment
Automobile chessis experimentAutomobile chessis experiment
Automobile chessis experimentAsheesh kushwaha
 

Mais de Asheesh kushwaha (8)

Thermal engineering question bank
Thermal engineering question bankThermal engineering question bank
Thermal engineering question bank
 
Strenght of material
Strenght of materialStrenght of material
Strenght of material
 
Electro chemical machine ( ecm )
Electro chemical machine ( ecm ) Electro chemical machine ( ecm )
Electro chemical machine ( ecm )
 
Scooter car servicing
Scooter car servicingScooter car servicing
Scooter car servicing
 
refrigeration system basic
refrigeration system  basicrefrigeration system  basic
refrigeration system basic
 
Exhaust gas recirculation ( egr) system
Exhaust gas recirculation  ( egr) system Exhaust gas recirculation  ( egr) system
Exhaust gas recirculation ( egr) system
 
Refrigeration handling and use of tool
Refrigeration handling  and use of toolRefrigeration handling  and use of tool
Refrigeration handling and use of tool
 
Automobile chessis experiment
Automobile chessis experimentAutomobile chessis experiment
Automobile chessis experiment
 

Último

Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...amitlee9823
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
ELKO dropshipping via API with DroFx.pptx
ELKO dropshipping via API with DroFx.pptxELKO dropshipping via API with DroFx.pptx
ELKO dropshipping via API with DroFx.pptxolyaivanovalion
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramMoniSankarHazra
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...amitlee9823
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...amitlee9823
 
ALSO dropshipping via API with DroFx.pptx
ALSO dropshipping via API with DroFx.pptxALSO dropshipping via API with DroFx.pptx
ALSO dropshipping via API with DroFx.pptxolyaivanovalion
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...amitlee9823
 

Último (20)

Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
ELKO dropshipping via API with DroFx.pptx
ELKO dropshipping via API with DroFx.pptxELKO dropshipping via API with DroFx.pptx
ELKO dropshipping via API with DroFx.pptx
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
ALSO dropshipping via API with DroFx.pptx
ALSO dropshipping via API with DroFx.pptxALSO dropshipping via API with DroFx.pptx
ALSO dropshipping via API with DroFx.pptx
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 

Operators and it's type

  • 1. Contents 1. Introduction of operators. 2. Types of operator 3. Arithmetic operator 4. Relational operator 5. Logical operator 6. Bitwise operator 7. Assignment operator 8. Conditional operator 9. Special operator 10. Increment and decrement operator.
  • 2. Introduction of operator :- C language supports a rich set of built-in operators. An operator is a symbol that tells the compiler to perform a certain mathematical or logical manipulation. Operators are used in programs to manipulate data and variables .
  • 3. Arithmetic operator:- C support all the basic arithmetic operators. The following table shows all the basic arithmetic operator. Operator Description + Adds two operands - Subtract second operands from first * Multiply two operands / Divide numerator by denominator % Remainder of devision ++ Increment operator –increases integer value by one -- Decrement operator – decreases integer value by one
  • 4. Relational operators The following table shows all relation operator supported by C. 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 operands is greater than or equal to right operands <= Check if operand on the left is smaller than or equal to right operand
  • 5. Logical operators C language supports following 3 logical operators . Suppose (a =1 ) an ( b= 0) Operator Description Example && Logical AND ( a&&b) is false || Logical OR ( a||b ) is true ! Logical NOT (!a) is false
  • 6. Bitwise operators Bitwise operators perform manipulation of data at bit level . These operators also perform shifting of bits from right to left . Bitwise operators are not applied to float or double. Operator Description & Bitwise AND | Bitwise OR ^ Bitwise exclusive OR << Left shift >> Right shift
  • 7. Now lets see truth table for bitwise & , | and ^ The bitwise shifts operators shifts the bit value . The left operand specifies the value to be shifted and the right operand Specifies the number of position that the bits in the value have to be shifted . Both operands have the same precedence. a b a & b a | b a ^b 0 0 0 0 0 0 1 0 1 1 1 0 0 1 1 1 1 1 1 0
  • 8. Assignment operator Assignment operators supported by C language are as follows. Operator Description Example = Assigns values From right side operands to left side operands a=b += Adds right operands to the left operands and assign the result to Left a+=b is same as a=a+b -= Substrect right operands from the left operand and assigns the result to Left operands a -=b is same as a = a – b
  • 9. *= Mutiply left operand with the right operand and assigns the result to Left operand a*= b is same as a = a*b / = Devides Left operand with the right operand and assign the result to left operand. a/=b is same as a=a/b %= Calculate modules assign Two operands and assigns the result to left operand a%=b is same as a=a%b
  • 10. Conditional operattor The conditional operators in C language are known by two more names . 1 Ternary operator 2 ?: Operator It is actually the if condition that we use in C language decision making , but using conditional operator ,we turn the if condition statement into a short and simple operator . The Syntex of a conditional operator is : Expression 1 ? Expression 2 : expression 3
  • 11. Special operators Operator Description Example Size of Returns the size of an variable Size of (x) return size of the variable X & Returns the address of an variable & X ; will be pointer t a varriable X * Pointer to a varriable *X ; will be pointer to varriable X
  • 12. Incrementanddecrementoperator Increament operators are used to increased the value of the varriable by one and Decrement operators are used to decrease the value of the varriable by one in C program . Both increment and Decrement operator are used on a single open and or variable , so it is called as a unary operator . Unary operators are having higher priority that the other operators it means unary operators are excuted before other operators. Syntax ; [ ++ // Increment operator ] [ -- // Decrement operator ]