SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Software Development  Training Program Mr.   Zia Khan, and Mr. Zeeshan Hanif
DotNet3.5 -101 Lecture 3 Zeeshan Hanif [email_address] [email_address]
Operators ,[object Object],[object Object],[object Object],[object Object]
Unary Operators ,[object Object],[object Object],[object Object],! - + ~ -- ++
Increment and Decrement Operator The ++ and – are increment and decrement operators. The increment operator increases its operand by one; the decrement operator decreases its operand by one. -- ++
Increment and Decrement Operator ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Increment and Decrement Operator ,[object Object],[object Object],[object Object],[object Object],[object Object]
Examples 6 5 b  =  a++ 5 4 4 b  =  --a 5 4 5 b  =  a-- 5 6 6 b  =  ++a 5 Final value of a Final value of b Expression Initial value of a
Bitwise Inversion Operator ,[object Object],~
Bitwise Inversion Operator ,[object Object],[object Object],[object Object],[object Object],[object Object]
Bitwise Inversion Operator ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Bitwise Inversion Operator ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Boolean Complement Operator ,[object Object],[object Object],[object Object],!
Binary Operators ,[object Object],[object Object],[object Object],Arithmetic Operators - + % / *
Binary Operators Comparison Operator Bitwise Operators Short Circuit Logical Operators | ^ & as is != == >= > <= < || &&
Binary Operators Assignment Operators ^= & = -= += % = /= *= =
Arithmetic Operators ,[object Object],- + % / *
Comparison Operator ,[object Object],as is != == >= > <= <
Comparison Operator Less than or equal to <= Greater than or equal to >= Less than <  Greater than >  Not equal to != Equal to == Result Operator
Bitwise Operator ,[object Object],| ^ &
Bitwise Operator (&) ,[object Object],1 1 0 0 Op1 1 1 0 0 0 1 0 0 Op1  AND  Op2 Op2
Bitwise Operator (|) ,[object Object],1 1 0 0 Op1 1 1 1 0 1 1 0 0 Op1  OR  Op2 Op2
Bitwise Operator (^) ,[object Object],1 1 0 0 Op1 0 1 1 0 1 1 0 0 Op1  XOR  Op2 Op2
Bitwise Operator ,[object Object]
Bitwise Operator (&) ,[object Object],true true false false Op1 true true false false false true false false Op1  AND  Op2 Op2
Bitwise Operator (|) ,[object Object],true true false false Op1 true true true false true true false false Op1  OR  Op2 Op2
Bitwise Operator (^) ,[object Object],true true false false Op1 false true true false true true false false Op1  XOR  Op2 Op2
Short Circuit Logical Operators ,[object Object],[object Object],|| &&
Short Circuit Logical Operators ,[object Object],[object Object]
Example ,[object Object],[object Object],[object Object]
Example ,[object Object],[object Object],[object Object]
Assignment Operators ^= & = -= += % = /= *= =
Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Ternary Operators ,[object Object],[object Object],[object Object],[object Object],[object Object]
Example ,[object Object],[object Object],[object Object],[object Object],[object Object]
Operator Precedence ,[object Object]
Operator Precedence =  *=  /=  %=  +=  -=  <<=  >>=  &=  ^=  |= Assignment ?: Conditional || Conditional OR && Conditional AND | Logical OR ^ Logical XOR & Logical And ==  != Equality <  >  <=  >=  is as Relational <<  >> Shift +  - Additive *  /  % Multiplicative =  -  !  ~  ++x  --x  (T)x Unary (x)  x.y  f(x)  a[x]  x++  x--  new  typeof  sizeof  checked  unchecked Primary Operators Category
Examples ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Examples ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Examples ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Escape Sequences ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Math class Math.Round(4.9) is 5 Math.Round(4.2) is 4 Math.Round(4.5) is  4 Rounds a value to the nearest integer  Round(x) Math.Min(5,9) is 5 Math.Min(5,-9) is -9 Returns the smaller of two number Min(x,y) Math.Max(5,9) is 9 Math.Max(5,-9) is 5 Returns the larger of two number Max(x,y) Math.Floor(5.4) is 5 Math.Floor(5.9) is 5 Returns the largest integer less then or equal to x Floor(x) Math.Ceiling(5.4) is 6 Math.Ceiling(5.9) is 6 Returns the smallest integer greater than or equal to the x Ceiling(x) Math.Abs(-45) is 45 Math.Abs(45) is 45 Returns the absolute value of x Abs(x) Example Description Methods
Math class Math.Truncate(38.4) is 38 Math.Truncate(38.485487) is 38 Returns the integral part of x Truncate(x) Math.Sqrt(9) is 3 Math.Sqrt(5) is 2.23606797749979 Returns the square root of x Sqrt(x) Math.Pow(4.2) is 16 Returns x raised to the power y Pow(x,y) Example Description Methods
Exercise ,[object Object],[object Object],[object Object]

Weitere Àhnliche Inhalte

Was ist angesagt?

PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
Maulik Borsaniya
 

Was ist angesagt? (20)

Operators in python
Operators in pythonOperators in python
Operators in python
 
Python strings
Python stringsPython strings
Python strings
 
Recursion
RecursionRecursion
Recursion
 
Python Flow Control
Python Flow ControlPython Flow Control
Python Flow Control
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
 
Python tuple
Python   tuplePython   tuple
Python tuple
 
Lists
ListsLists
Lists
 
Python strings presentation
Python strings presentationPython strings presentation
Python strings presentation
 
Set methods in python
Set methods in pythonSet methods in python
Set methods in python
 
Introduction to Python
Introduction to Python  Introduction to Python
Introduction to Python
 
Recursion
RecursionRecursion
Recursion
 
Sets, functions and groups
Sets, functions and groupsSets, functions and groups
Sets, functions and groups
 
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
 
Python Control structures
Python Control structuresPython Control structures
Python Control structures
 
Strings in c++
Strings in c++Strings in c++
Strings in c++
 
Arrays
ArraysArrays
Arrays
 
Functions in python
Functions in pythonFunctions in python
Functions in python
 
Python : Operators
Python : OperatorsPython : Operators
Python : Operators
 
Arrays in C language
Arrays in C languageArrays in C language
Arrays in C language
 
Python Data Structures and Algorithms.pptx
Python Data Structures and Algorithms.pptxPython Data Structures and Algorithms.pptx
Python Data Structures and Algorithms.pptx
 

Ähnlich wie Operators

C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)
jahanullah
 
C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)
guest58c84c
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
bajiajugal
 
Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statements
CtOlaf
 
Chapter 3.3
Chapter 3.3Chapter 3.3
Chapter 3.3
sotlsoc
 
05 operators
05   operators05   operators
05 operators
dhrubo kayal
 

Ähnlich wie Operators (20)

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)
 
Operators and expressions in C++
Operators and expressions in C++Operators and expressions in C++
Operators and expressions in C++
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++
 
C++ Expressions Notes
C++ Expressions NotesC++ Expressions Notes
C++ Expressions Notes
 
Operators
OperatorsOperators
Operators
 
operators and expressions in c++
 operators and expressions in c++ operators and expressions in c++
operators and expressions in c++
 
Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statements
 
This slide contains information about Operators in C.pptx
This slide contains information about Operators in C.pptxThis slide contains information about Operators in C.pptx
This slide contains information about Operators in C.pptx
 
Chapter 3.3
Chapter 3.3Chapter 3.3
Chapter 3.3
 
Project in TLE
Project in TLEProject in TLE
Project in TLE
 
6 operators-in-c
6 operators-in-c6 operators-in-c
6 operators-in-c
 
6 operators-in-c
6 operators-in-c6 operators-in-c
6 operators-in-c
 
Operators inc c language
Operators inc c languageOperators inc c language
Operators inc c language
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c language
 
C++
C++ C++
C++
 
05 operators
05   operators05   operators
05 operators
 
C language basics
C language basicsC language basics
C language basics
 
Conditional and special operators
Conditional and special operatorsConditional and special operators
Conditional and special operators
 

Mehr von Kamran (7)

History
HistoryHistory
History
 
Loops
LoopsLoops
Loops
 
Introduction
IntroductionIntroduction
Introduction
 
Chapter3
Chapter3Chapter3
Chapter3
 
C chap02
C chap02C chap02
C chap02
 
C introduction
C introductionC introduction
C introduction
 
C intro
C introC intro
C intro
 

KĂŒrzlich hochgeladen

Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
daisycvs
 
Chandigarh Escorts Service 📞8868886958📞 JustđŸ“Č Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 JustđŸ“Č Call Nihal Chandigarh Call Girl...Chandigarh Escorts Service 📞8868886958📞 JustđŸ“Č Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 JustđŸ“Č Call Nihal Chandigarh Call Girl...
Sheetaleventcompany
 
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
Call Now â˜ŽïžđŸ” 9332606886🔝 Call Girls ❀ Service In Bhilwara Female Escorts Serv...
Call Now â˜ŽïžđŸ” 9332606886🔝 Call Girls ❀ Service In Bhilwara Female Escorts Serv...Call Now â˜ŽïžđŸ” 9332606886🔝 Call Girls ❀ Service In Bhilwara Female Escorts Serv...
Call Now â˜ŽïžđŸ” 9332606886🔝 Call Girls ❀ Service In Bhilwara Female Escorts Serv...
Anamikakaur10
 
Call Girls From Pari Chowk Greater Noida ❀8448577510 âŠčBest Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❀8448577510 âŠčBest Escorts Service I...Call Girls From Pari Chowk Greater Noida ❀8448577510 âŠčBest Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❀8448577510 âŠčBest Escorts Service I...
lizamodels9
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
Matteo Carbone
 
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
amitlee9823
 
Call Girls Zirakpur👧 Book NowđŸ“±7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book NowđŸ“±7837612180 📞👉Call Girl Service In Zirakpur No A...Call Girls Zirakpur👧 Book NowđŸ“±7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book NowđŸ“±7837612180 📞👉Call Girl Service In Zirakpur No A...
Sheetaleventcompany
 
Call Girls In Noida 959961âŠč3876 Independent Escort Service Noida
Call Girls In Noida 959961âŠč3876 Independent Escort Service NoidaCall Girls In Noida 959961âŠč3876 Independent Escort Service Noida
Call Girls In Noida 959961âŠč3876 Independent Escort Service Noida
dlhescort
 

KĂŒrzlich hochgeladen (20)

Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
 
Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1
 
Chandigarh Escorts Service 📞8868886958📞 JustđŸ“Č Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 JustđŸ“Č Call Nihal Chandigarh Call Girl...Chandigarh Escorts Service 📞8868886958📞 JustđŸ“Č Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 JustđŸ“Č Call Nihal Chandigarh Call Girl...
 
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptx
 
Call Now â˜ŽïžđŸ” 9332606886🔝 Call Girls ❀ Service In Bhilwara Female Escorts Serv...
Call Now â˜ŽïžđŸ” 9332606886🔝 Call Girls ❀ Service In Bhilwara Female Escorts Serv...Call Now â˜ŽïžđŸ” 9332606886🔝 Call Girls ❀ Service In Bhilwara Female Escorts Serv...
Call Now â˜ŽïžđŸ” 9332606886🔝 Call Girls ❀ Service In Bhilwara Female Escorts Serv...
 
Call Girls From Pari Chowk Greater Noida ❀8448577510 âŠčBest Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❀8448577510 âŠčBest Escorts Service I...Call Girls From Pari Chowk Greater Noida ❀8448577510 âŠčBest Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❀8448577510 âŠčBest Escorts Service I...
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptx
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
 
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 May
 
Eluru Call Girls Service ☎ 93326-06886 â€ïžâ€đŸ”„ Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ 93326-06886 â€ïžâ€đŸ”„ Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ 93326-06886 â€ïžâ€đŸ”„ Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ 93326-06886 â€ïžâ€đŸ”„ Enjoy 24/7 Escort Service
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and pains
 
Call Girls Zirakpur👧 Book NowđŸ“±7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book NowđŸ“±7837612180 📞👉Call Girl Service In Zirakpur No A...Call Girls Zirakpur👧 Book NowđŸ“±7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book NowđŸ“±7837612180 📞👉Call Girl Service In Zirakpur No A...
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
 
Call Girls In Noida 959961âŠč3876 Independent Escort Service Noida
Call Girls In Noida 959961âŠč3876 Independent Escort Service NoidaCall Girls In Noida 959961âŠč3876 Independent Escort Service Noida
Call Girls In Noida 959961âŠč3876 Independent Escort Service Noida
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Service
 
Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investors
 

Operators

  • 1. Software Development Training Program Mr. Zia Khan, and Mr. Zeeshan Hanif
  • 2. DotNet3.5 -101 Lecture 3 Zeeshan Hanif [email_address] [email_address]
  • 3.
  • 4.
  • 5. Increment and Decrement Operator The ++ and – are increment and decrement operators. The increment operator increases its operand by one; the decrement operator decreases its operand by one. -- ++
  • 6.
  • 7.
  • 8. Examples 6 5 b = a++ 5 4 4 b = --a 5 4 5 b = a-- 5 6 6 b = ++a 5 Final value of a Final value of b Expression Initial value of a
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. Binary Operators Comparison Operator Bitwise Operators Short Circuit Logical Operators | ^ & as is != == >= > <= < || &&
  • 16. Binary Operators Assignment Operators ^= & = -= += % = /= *= =
  • 17.
  • 18.
  • 19. Comparison Operator Less than or equal to <= Greater than or equal to >= Less than < Greater than > Not equal to != Equal to == Result Operator
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32. Assignment Operators ^= & = -= += % = /= *= =
  • 33.
  • 34.
  • 35.
  • 36.
  • 37. Operator Precedence = *= /= %= += -= <<= >>= &= ^= |= Assignment ?: Conditional || Conditional OR && Conditional AND | Logical OR ^ Logical XOR & Logical And == != Equality < > <= >= is as Relational << >> Shift + - Additive * / % Multiplicative = - ! ~ ++x --x (T)x Unary (x) x.y f(x) a[x] x++ x-- new typeof sizeof checked unchecked Primary Operators Category
  • 38.
  • 39.
  • 40.
  • 41.
  • 42. Math class Math.Round(4.9) is 5 Math.Round(4.2) is 4 Math.Round(4.5) is 4 Rounds a value to the nearest integer Round(x) Math.Min(5,9) is 5 Math.Min(5,-9) is -9 Returns the smaller of two number Min(x,y) Math.Max(5,9) is 9 Math.Max(5,-9) is 5 Returns the larger of two number Max(x,y) Math.Floor(5.4) is 5 Math.Floor(5.9) is 5 Returns the largest integer less then or equal to x Floor(x) Math.Ceiling(5.4) is 6 Math.Ceiling(5.9) is 6 Returns the smallest integer greater than or equal to the x Ceiling(x) Math.Abs(-45) is 45 Math.Abs(45) is 45 Returns the absolute value of x Abs(x) Example Description Methods
  • 43. Math class Math.Truncate(38.4) is 38 Math.Truncate(38.485487) is 38 Returns the integral part of x Truncate(x) Math.Sqrt(9) is 3 Math.Sqrt(5) is 2.23606797749979 Returns the square root of x Sqrt(x) Math.Pow(4.2) is 16 Returns x raised to the power y Pow(x,y) Example Description Methods
  • 44.