3 statements and operators

727 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
727
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
18
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

3 statements and operators

  1. 1. Statements and Expressions Programming in C# tnngo2@gmail.com
  2. 2. Types of Statements Selection | if, else, switch, case Iteration | for, foreach, while Jump | break, continue, default, goto, return, yield Exception Handling | throw, try-catch, try-finally, try-catch-finally Checked and Unchecked Fixed | fixed, unsafe Lock
  3. 3. Types of Operators
  4. 4. Types of Operators Arithmetic Relational Logical Conditional Increment and Decrement Assignment
  5. 5. Arithmetic Operators are binary operators.
  6. 6. Relational Operators
  7. 7. Logical Operators Boolean Logical Operators Bitwise Logical Operators
  8. 8. Bitwise Logical Operators Boolean Logical Operators http://pastebin.com/BuXr5Zxq AND
  9. 9. Conditional Operators AND (&&) evaluates the second expression only if the first one return true. https://gist.github.com/2318365 OR (||) evaluates the second expression only if the first one return false. https://gist.github.com/2318398
  10. 10. Increment and Decrement Operators
  11. 11. Assignment Operators
  12. 12. Precedence and Associativity
  13. 13. Data Conversions
  14. 14. Typecasting
  15. 15. Implicit typecasting (Coercion) refers to an automatic conversion of data type done when the destination data types belong to the same hierarchy and the destination data type must hold a larger range of values than the source data type https://gist.github.com/2318445
  16. 16. Implicit typecasting (Coercion)
  17. 17. Explicit typecasting refers to changing a data type of higher precision into a data type of lower precision. the destination data type hold a smaller range of values than the source data type <tager data type> <variable name> = (target data type) <source data type>; https://gist.github.com/2318452
  18. 18. Explicit typecasting using built-in method System.Convert class Convert.ToChar(float) ToString() method https://gist.github.com/2318468
  19. 19. Boxing converting a value type to its reference type.
  20. 20. Unboxing converting a reference type to a value type
  21. 21. Boxing & Unboxing https://gist.github.com/2318516
  22. 22. Question? What is the result of the following code snippets? https://gist.github.com/2318553
  23. 23. Question? What is the result of the following code snippets? https://gist.github.com/2318553

×