SlideShare una empresa de Scribd logo
1 de 43
Software Development  Training Program KaZIM HUSSAIn
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 Initial value of a Expression Final value of b Final value of a 5 b  =  a++ 5 6 5 b  =  ++a 6 6 5 b  =  a-- 5 4 5 b  =  --a 4 4
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 & ^ | < <= > >= == != is as && ||
Binary Operators Assignment Operators = *= /= % = += -= & = ^= |=
Arithmetic Operators ,[object Object],* / % + -
Comparison Operator ,[object Object],< <= > >= == != is as
Comparison Operator Operator Result == Equal to != Not equal to >  Greater than <  Less than >= Greater than or equal to <= Less than or equal to
Bitwise Operator ,[object Object],& ^ |
Bitwise Operator (&) ,[object Object],Op1 Op2 Op1  AND  Op2 0 0 0 0 1 0 1 0 0 1 1 1
Bitwise Operator (|) ,[object Object],Op1 Op2 Op1  OR  Op2 0 0 0 0 1 1 1 0 1 1 1 1
Bitwise Operator (^) ,[object Object],Op1 Op2 Op1  XOR  Op2 0 0 0 0 1 1 1 0 1 1 1 0
Bitwise Operator ,[object Object]
Bitwise Operator (&) ,[object Object],Op1 Op2 Op1  AND  Op2 false false false false true false true false false true true true
Bitwise Operator (|) ,[object Object],Op1 Op2 Op1  OR  Op2 false false false false true true true false true true true true
Bitwise Operator (^) ,[object Object],Op1 Op2 Op1  XOR  Op2 false false false false true true true false true true true false
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],[object Object]
Operator Precedence Category Operators Primary (x)  x.y  f(x)  a[x]  x++  x--  new  typeof  sizeof  checked  unchecked Unary =  -  !  ~  ++x  --x  (T)x Multiplicative *  /  % Additive +  - Shift <<  >> Relational <  >  <=  >=  is as Equality ==  != Logical And & Logical XOR ^ Logical OR | Conditional AND && Conditional OR || Conditional ?: Assignment =  *=  /=  %=  +=  -=  <<=  >>=  &=  ^=  |=
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 Methods Description Example Abs(x) Returns the absolute value of x Math.Abs(-45) is 45 Math.Abs(45) is 45 Round(x) Rounds a value to the nearest integer  Math.Round(4.9) is 5 Math.Round(4.2) is 4 Math.Round(4.5) is  4 Ceiling(x) Returns the smallest integer greater than or equal to the x Math.Ceiling(5.4) is 6 Math.Ceiling(5.9) is 6 Floor(x) Returns the largest integer less then or equal to x Math.Floor(5.4) is 5 Math.Floor(5.9) is 5 Max(x,y) Returns the larger of two number Math.Max(5,9) is 9 Math.Max(5,-9) is 5 Min(x,y) Returns the smaller of two number Math.Min(5,9) is 5 Math.Min(5,-9) is -9
Math class Methods Description Example Pow(x,y) Returns x raised to the power y Math.Pow(4,2) is 16 Sqrt(x) Returns the square root of x Math.Sqrt(9) is 3 Math.Sqrt(5) is 2.23606797749979 Truncate(x) Returns the integral part of x Math.Truncate(38.4) is 38 Math.Truncate(38.485487) is 38
Exercise ,[object Object],[object Object],[object Object]

Más contenido relacionado

La actualidad más candente

Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
bajiajugal
 
Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Chapter 5 - Operators in C++
Chapter 5 - Operators in C++
Deepak Singh
 
Basic c operators
Basic c operatorsBasic c operators
Basic c operators
dishti7
 

La actualidad más candente (18)

Python Operators
Python OperatorsPython Operators
Python Operators
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Python operators
Python operatorsPython operators
Python operators
 
Operators and Expressions
Operators and ExpressionsOperators and Expressions
Operators and Expressions
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
 
Operators in C & C++ Language
Operators in C & C++ LanguageOperators in C & C++ Language
Operators in C & C++ Language
 
Operation and expression in c++
Operation and expression in c++Operation and expression in c++
Operation and expression in c++
 
Operators and expressions in C++
Operators and expressions in C++Operators and expressions in C++
Operators and expressions in C++
 
Operator.ppt
Operator.pptOperator.ppt
Operator.ppt
 
Operators in c++
Operators in c++Operators in c++
Operators in c++
 
Fundamentals of Programming Chapter 5
Fundamentals of Programming Chapter 5Fundamentals of Programming Chapter 5
Fundamentals of Programming Chapter 5
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++
 
C – operators and expressions
C – operators and expressionsC – operators and expressions
C – operators and expressions
 
Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Chapter 5 - Operators in C++
Chapter 5 - Operators in C++
 
Operators in C/C++
Operators in C/C++Operators in C/C++
Operators in C/C++
 
Expression and Operartor In C Programming
Expression and Operartor In C Programming Expression and Operartor In C Programming
Expression and Operartor In C Programming
 
Basic c operators
Basic c operatorsBasic c operators
Basic c operators
 
Input processing and output in Python
Input processing and output in PythonInput processing and output in Python
Input processing and output in Python
 

Destacado (6)

C Sharp Nagina (1)
C Sharp Nagina (1)C Sharp Nagina (1)
C Sharp Nagina (1)
 
C Sharp Jn
C Sharp JnC Sharp Jn
C Sharp Jn
 
Microsoft .NET Framework
Microsoft .NET FrameworkMicrosoft .NET Framework
Microsoft .NET Framework
 
Reuters: Pictures of the Year 2016 (Part 2)
Reuters: Pictures of the Year 2016 (Part 2)Reuters: Pictures of the Year 2016 (Part 2)
Reuters: Pictures of the Year 2016 (Part 2)
 
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsThe Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post Formats
 
The Outcome Economy
The Outcome EconomyThe Outcome Economy
The Outcome Economy
 

Similar a C Sharp Jn (2)

Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statements
CtOlaf
 

Similar a C Sharp Jn (2) (20)

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++
 
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
 
05 operators
05   operators05   operators
05 operators
 
C++
C++ C++
C++
 
Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statements
 
python operators.ppt
python operators.pptpython operators.ppt
python operators.ppt
 
Py-Slides-2 (1).ppt
Py-Slides-2 (1).pptPy-Slides-2 (1).ppt
Py-Slides-2 (1).ppt
 
Py-Slides-2.ppt
Py-Slides-2.pptPy-Slides-2.ppt
Py-Slides-2.ppt
 
Py-Slides-2.ppt
Py-Slides-2.pptPy-Slides-2.ppt
Py-Slides-2.ppt
 
Project in TLE
Project in TLEProject in TLE
Project in TLE
 
Operators
OperatorsOperators
Operators
 
C language basics
C language basicsC language basics
C language basics
 
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
 
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
 
Types of Operators in C
Types of Operators in CTypes of Operators in C
Types of Operators in C
 
Report Group 4 Constants and Variables
Report Group 4 Constants and VariablesReport Group 4 Constants and Variables
Report Group 4 Constants and Variables
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

C Sharp Jn (2)

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