SlideShare a Scribd company logo
1 of 28
01/08/11 By Jag PRESENTATION  ON OPERATORS IN C
Topics ,[object Object],[object Object],01/08/11 By Jag
Classification   ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],01/08/11 By Jag
Arithmetic Operators ,[object Object],[object Object],[object Object],01/08/11 By Jag
Integer Arithmetic   ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],01/08/11 By Jag
Use of integer arithmetic ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],01/08/11 By Jag
Real Arithmetic ,[object Object],[object Object],[object Object],[object Object],[object Object],01/08/11 By Jag
Mixed –mode  Arithmetic ,[object Object],[object Object],[object Object],01/08/11 By Jag
Conditional operators ,[object Object],[object Object],[object Object],01/08/11 By Jag
Example   01/08/11 By Jag a=16 b=25; x=(a>b) ? a : b; if (a>b)  x=a; else    x=b;
Bitwise operators 01/08/11 By Jag Operator Meaning & Bitwise AND  |  Bitwise OR  ^  Bitwise Exclusive << Shift left  >>  Shift right
Result of logical Bitwise Operation 01/08/11 By Jag op1 op2 op1&op2 op1|op2 op1^op2 1 1 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 0 0 0
Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],01/08/11 By Jag
Bitwise Exclusive OR x - - -> 0000 0000 0000 1101 y - - -> 0000 0000 0001 1001 x^y - - -> 0000 0000 0001 0100 01/08/11 By Jag
Bitwise shift operators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],01/08/11 By Jag
Bitwise Complement Operators ,[object Object],01/08/11 By Jag
Relational Operators 01/08/11 By Jag Operator Meaning  <  is less than  <=  is less than or equal to  >  is greater than  >=  is greater than or equal to  ==  is equal to  !=  is not equal to
Logical operators 01/08/11 By Jag Operator Meaning  &&  Logical AND  ||  Logical OR  !  Logical NOT
Examples ,[object Object],[object Object],[object Object],[object Object],01/08/11 By Jag
Assignment Operators  ,[object Object],01/08/11 By Jag
Increment and Decrement ,[object Object],[object Object],[object Object],01/08/11 By Jag
Special operators ,[object Object],[object Object],[object Object],[object Object],01/08/11 By Jag
Comma operator ,[object Object],[object Object],[object Object],[object Object],[object Object],01/08/11 By Jag
The sizeof Operator ,[object Object],[object Object],[object Object],[object Object],01/08/11 By Jag
Precedence and Associativity ,[object Object],[object Object],01/08/11 By Jag
Summary of C operator  01/08/11 By Jag Description  Operator Rank Associativity Function call Array element reference  ( ) [] 1 Left to right  Unary plus  Unary minus  Increment  Decrement  Logical negation Ones complement  Address Size of an object  + - ++ -- ! ~ & Sizeof  2 Right to left  Multiplication Division Modulus * / % 3 Left to right  Addition Subtraction + - 4 Left to right Left shift Right shift << >> 5 Left to right Less than Less than equal to Greater than  Greater than equal to < <= > >= 6 Left to right Equality Inequality = = |= 7 Left to right
Continue…. 01/08/11 By Jag Bitwise AND & 8 Left to right Bitwise XOR ^ 9 Left to right Bitwise OR | 10 Left to right Logical AND  && 11 Left to right Logical OR || 12 Left to right Conditional operator ?: 13 Right to left Assignment operator = *=/=%= +=-=&= ^=|= << = >>= 14 Right to left Commas operator , 15 Left to right
01/08/11 By Jag

More Related Content

What's hot

Mobile Data Analytics
Mobile Data AnalyticsMobile Data Analytics
Mobile Data AnalyticsRICHARD AMUOK
 
Operator in c programming
Operator in c programmingOperator in c programming
Operator in c programmingManoj Tyagi
 
Operators in C/C++
Operators in C/C++Operators in C/C++
Operators in C/C++Shobi P P
 
Chapter 8 getting started with python
Chapter 8 getting started with pythonChapter 8 getting started with python
Chapter 8 getting started with pythonPraveen M Jigajinni
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersDr. Loganathan R
 
Types of c operators ppt
Types of c operators pptTypes of c operators ppt
Types of c operators pptViraj Shah
 
peas description of task environment with different types of properties
 peas description of task environment with different types of properties peas description of task environment with different types of properties
peas description of task environment with different types of propertiesmonircse2
 
Operator Precedence and Associativity
Operator Precedence and AssociativityOperator Precedence and Associativity
Operator Precedence and AssociativityNicole Ynne Estabillo
 
Introduction to Python for Data Science and Machine Learning
Introduction to Python for Data Science and Machine Learning Introduction to Python for Data Science and Machine Learning
Introduction to Python for Data Science and Machine Learning ParrotAI
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of PythonElewayte
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c languagetanmaymodi4
 
RDM 2020: Python, Numpy, and Pandas
RDM 2020: Python, Numpy, and PandasRDM 2020: Python, Numpy, and Pandas
RDM 2020: Python, Numpy, and PandasHenry Schreiner
 

What's hot (20)

Mobile Data Analytics
Mobile Data AnalyticsMobile Data Analytics
Mobile Data Analytics
 
Report on c
Report on cReport on c
Report on c
 
Operators in C & C++ Language
Operators in C & C++ LanguageOperators in C & C++ Language
Operators in C & C++ Language
 
Operator in c programming
Operator in c programmingOperator in c programming
Operator in c programming
 
Operators in C/C++
Operators in C/C++Operators in C/C++
Operators in C/C++
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
 
Python : Operators
Python : OperatorsPython : Operators
Python : Operators
 
Chapter 8 getting started with python
Chapter 8 getting started with pythonChapter 8 getting started with python
Chapter 8 getting started with python
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointers
 
Types of c operators ppt
Types of c operators pptTypes of c operators ppt
Types of c operators ppt
 
peas description of task environment with different types of properties
 peas description of task environment with different types of properties peas description of task environment with different types of properties
peas description of task environment with different types of properties
 
Operators
OperatorsOperators
Operators
 
Operator Precedence and Associativity
Operator Precedence and AssociativityOperator Precedence and Associativity
Operator Precedence and Associativity
 
Introduction to Python for Data Science and Machine Learning
Introduction to Python for Data Science and Machine Learning Introduction to Python for Data Science and Machine Learning
Introduction to Python for Data Science and Machine Learning
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of Python
 
Relational operators
Relational operatorsRelational operators
Relational operators
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c language
 
RDM 2020: Python, Numpy, and Pandas
RDM 2020: Python, Numpy, and PandasRDM 2020: Python, Numpy, and Pandas
RDM 2020: Python, Numpy, and Pandas
 
C operator and expression
C operator and expressionC operator and expression
C operator and expression
 
Python : basic operators
Python : basic operatorsPython : basic operators
Python : basic operators
 

Similar to C ppt

Similar to C ppt (20)

Operators
OperatorsOperators
Operators
 
C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)
 
C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
 
5_Operators.pdf
5_Operators.pdf5_Operators.pdf
5_Operators.pdf
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
 
Python Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.inPython Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.in
 
Operators in java
Operators in javaOperators in java
Operators in java
 
Operators
OperatorsOperators
Operators
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Opeartor &amp; expression
Opeartor &amp; expressionOpeartor &amp; expression
Opeartor &amp; expression
 
Operator 04 (js)
Operator 04 (js)Operator 04 (js)
Operator 04 (js)
 
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
 
OPERATORS OF C++
OPERATORS OF C++OPERATORS OF C++
OPERATORS OF C++
 
Python tutorials for beginners | IQ Online Training
Python tutorials for beginners | IQ Online TrainingPython tutorials for beginners | IQ Online Training
Python tutorials for beginners | IQ Online Training
 
Coper in C
Coper in CCoper in C
Coper in C
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
Operators
OperatorsOperators
Operators
 

C ppt

  • 1. 01/08/11 By Jag PRESENTATION ON OPERATORS IN C
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Example 01/08/11 By Jag a=16 b=25; x=(a>b) ? a : b; if (a>b) x=a; else x=b;
  • 11. Bitwise operators 01/08/11 By Jag Operator Meaning & Bitwise AND | Bitwise OR ^ Bitwise Exclusive << Shift left >> Shift right
  • 12. Result of logical Bitwise Operation 01/08/11 By Jag op1 op2 op1&op2 op1|op2 op1^op2 1 1 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 0 0 0
  • 13.
  • 14. Bitwise Exclusive OR x - - -> 0000 0000 0000 1101 y - - -> 0000 0000 0001 1001 x^y - - -> 0000 0000 0001 0100 01/08/11 By Jag
  • 15.
  • 16.
  • 17. Relational Operators 01/08/11 By Jag Operator Meaning < is less than <= is less than or equal to > is greater than >= is greater than or equal to == is equal to != is not equal to
  • 18. Logical operators 01/08/11 By Jag Operator Meaning && Logical AND || Logical OR ! Logical NOT
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. Summary of C operator 01/08/11 By Jag Description Operator Rank Associativity Function call Array element reference ( ) [] 1 Left to right Unary plus Unary minus Increment Decrement Logical negation Ones complement Address Size of an object + - ++ -- ! ~ & Sizeof 2 Right to left Multiplication Division Modulus * / % 3 Left to right Addition Subtraction + - 4 Left to right Left shift Right shift << >> 5 Left to right Less than Less than equal to Greater than Greater than equal to < <= > >= 6 Left to right Equality Inequality = = |= 7 Left to right
  • 27. Continue…. 01/08/11 By Jag Bitwise AND & 8 Left to right Bitwise XOR ^ 9 Left to right Bitwise OR | 10 Left to right Logical AND && 11 Left to right Logical OR || 12 Left to right Conditional operator ?: 13 Right to left Assignment operator = *=/=%= +=-=&= ^=|= << = >>= 14 Right to left Commas operator , 15 Left to right