SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressionsvishaljot_kaur
 
Increment and Decrement operators in C++
Increment and Decrement operators in C++Increment and Decrement operators in C++
Increment and Decrement operators in C++Neeru Mittal
 
Exact &amp; non exact differential equation
Exact &amp; non exact differential equationExact &amp; non exact differential equation
Exact &amp; non exact differential equationAlaminMdBabu
 
Unit 1 quantifiers
Unit 1  quantifiersUnit 1  quantifiers
Unit 1 quantifiersraksharao
 
Array within a class
Array within a classArray within a class
Array within a classAAKASH KUMAR
 
Jumping statements
Jumping statementsJumping statements
Jumping statementsSuneel Dogra
 
language , grammar and automata
language , grammar and automatalanguage , grammar and automata
language , grammar and automataElakkiyaS11
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).pptAlok Kumar
 
Top down and botttom up Parsing
Top down     and botttom up ParsingTop down     and botttom up Parsing
Top down and botttom up ParsingGerwin Ocsena
 
Minimization of Boolean Functions
Minimization of Boolean FunctionsMinimization of Boolean Functions
Minimization of Boolean Functionsblaircomp2003
 
Asymptotic Notation and Data Structures
Asymptotic Notation and Data StructuresAsymptotic Notation and Data Structures
Asymptotic Notation and Data StructuresAmrinder Arora
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithmRezwan Siam
 

Was ist angesagt? (20)

Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressions
 
Increment and Decrement operators in C++
Increment and Decrement operators in C++Increment and Decrement operators in C++
Increment and Decrement operators in C++
 
Exact &amp; non exact differential equation
Exact &amp; non exact differential equationExact &amp; non exact differential equation
Exact &amp; non exact differential equation
 
Constructor
ConstructorConstructor
Constructor
 
Python algorithm
Python algorithmPython algorithm
Python algorithm
 
Control statements in c
Control statements in cControl statements in c
Control statements in c
 
Graph theory presentation
Graph theory presentationGraph theory presentation
Graph theory presentation
 
Operators in C++
Operators in C++Operators in C++
Operators in C++
 
Unit 1 quantifiers
Unit 1  quantifiersUnit 1  quantifiers
Unit 1 quantifiers
 
Array within a class
Array within a classArray within a class
Array within a class
 
Jumping statements
Jumping statementsJumping statements
Jumping statements
 
language , grammar and automata
language , grammar and automatalanguage , grammar and automata
language , grammar and automata
 
Functions in c++
Functions in c++Functions in c++
Functions in c++
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).ppt
 
Top down and botttom up Parsing
Top down     and botttom up ParsingTop down     and botttom up Parsing
Top down and botttom up Parsing
 
Minimization of Boolean Functions
Minimization of Boolean FunctionsMinimization of Boolean Functions
Minimization of Boolean Functions
 
Asymptotic Notation and Data Structures
Asymptotic Notation and Data StructuresAsymptotic Notation and Data Structures
Asymptotic Notation and Data Structures
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithm
 
Metric space
Metric spaceMetric space
Metric space
 
Computer Science:Pointers in C
Computer Science:Pointers in CComputer Science:Pointers in C
Computer Science:Pointers in C
 

Ähnlich wie C ppt

Ähnlich wie 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)
 
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
 
Operators in C/C++
Operators in C/C++Operators in C/C++
Operators in C/C++
 
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
 
Report on c
Report on cReport on c
Report on c
 
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