SlideShare a Scribd company logo
Statements and
  Expressions
          Programming in C#




             tnngo2@gmail.com
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
Types of Operators
Types of Operators

      Arithmetic
      Relational
      Logical
      Conditional
      Increment and Decrement
      Assignment
Arithmetic Operators

      are binary operators.
Relational Operators
Logical Operators
      Boolean Logical Operators




      Bitwise Logical Operators
Bitwise Logical Operators
      Boolean Logical Operators

      http://pastebin.com/BuXr5Zxq

               AND
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
Increment and Decrement Operators
Assignment Operators
Precedence and Associativity
Data Conversions
Typecasting
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
Implicit typecasting (Coercion)
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
Explicit typecasting using built-in method
      System.Convert class
              Convert.ToChar(float)

      ToString() method
              https://gist.github.com/2318468
Boxing
         converting a value type to its reference type.
Unboxing
     converting a reference type to a value type
Boxing & Unboxing
      https://gist.github.com/2318516
Question?

     What is the result of the following code snippets?


     https://gist.github.com/2318553
Question?

     What is the result of the following code snippets?


     https://gist.github.com/2318553

More Related Content

PPTX
LISP: Scope and extent in lisp
PPTX
Programming in python - Week 2
PPTX
Data Structure and Algorithms –Introduction.pptx
PPT
Interfaces
PDF
Bt0066 database management system2
PPT
Sdd Syntax Descriptions
PPT
Control structures selection
PPT
Designing A Syntax Based Retrieval System03
LISP: Scope and extent in lisp
Programming in python - Week 2
Data Structure and Algorithms –Introduction.pptx
Interfaces
Bt0066 database management system2
Sdd Syntax Descriptions
Control structures selection
Designing A Syntax Based Retrieval System03

What's hot (20)

PDF
ma12012id536
PDF
Database management system session 5
PDF
Python Fundamentals Class 11
PDF
Lambda expression par Christophe Huntzinger
PDF
Recursion CBSE Class 12
PPTX
Java 8 Functional Programming - I
PDF
Asp.net main
PPSX
Control Structures in Visual Basic
PDF
Functions
PPT
evaluation rules
PPT
What To Expect With C
PPTX
Semantic scaffolds for pseudocode to-code generation (2020)
PPTX
If and select statement
PPTX
Lecture 18
PDF
New c sharp3_features_(linq)_part_v
PPTX
Test 3 exam review guide
PPTX
C# Basics
PPTX
chap4 : Converting and Casting (scjp/ocjp)
PDF
record_linking
ma12012id536
Database management system session 5
Python Fundamentals Class 11
Lambda expression par Christophe Huntzinger
Recursion CBSE Class 12
Java 8 Functional Programming - I
Asp.net main
Control Structures in Visual Basic
Functions
evaluation rules
What To Expect With C
Semantic scaffolds for pseudocode to-code generation (2020)
If and select statement
Lecture 18
New c sharp3_features_(linq)_part_v
Test 3 exam review guide
C# Basics
chap4 : Converting and Casting (scjp/ocjp)
record_linking
Ad

Viewers also liked (20)

PPTX
PPT
Monopolios en el Ecuador
PPT
համացանցը և ես1
PPTX
Pearl Harbor Tour Webinar
PDF
Skin cancer exposed - Tools' information
PPTX
thebpmfreak
DOCX
Printscreens for budget
PDF
Yourprezi
PPTX
X commerce open stack beijing keynote - 2012-08-10 final
PPT
Acids and Bases Day 5.2012
PPTX
Ear study guide
PDF
Open stack for open source private cloud 20120425-shanghai
PPT
real estate dealer in patna 9304611353
PPT
Ndiaye Agricultural non family workers (Sourga) in Senegal River Valley
PDF
Badoo Desktop: оптимизация приложения на миллион юзеров онлайн
PPT
Jeopardy 2011 Test #1
PPT
Power Notes Atomic Structure -Day 2
PDF
Стратегия развития фонда
PDF
Messen mit PHP
PPTX
Holes and Goal Presentation
Monopolios en el Ecuador
համացանցը և ես1
Pearl Harbor Tour Webinar
Skin cancer exposed - Tools' information
thebpmfreak
Printscreens for budget
Yourprezi
X commerce open stack beijing keynote - 2012-08-10 final
Acids and Bases Day 5.2012
Ear study guide
Open stack for open source private cloud 20120425-shanghai
real estate dealer in patna 9304611353
Ndiaye Agricultural non family workers (Sourga) in Senegal River Valley
Badoo Desktop: оптимизация приложения на миллион юзеров онлайн
Jeopardy 2011 Test #1
Power Notes Atomic Structure -Day 2
Стратегия развития фонда
Messen mit PHP
Holes and Goal Presentation
Ad

Similar to 3 statements and operators (20)

PPT
Lecture 2
PPTX
Operators & Casts
PPTX
3 operators-expressions-and-statements-120712073351-phpapp01
PPTX
3 operators-expressions-and-statements-120712073351-phpapp01
PPTX
03. operators and-expressions
PPTX
03. Operators Expressions and statements
PPS
02 iec t1_s1_oo_ps_session_02
PPTX
C# 101: Intro to Programming with C#
PPT
03 Operators and expressions
PPTX
C sharp part 001
PPTX
Module2.2_Operators-in-C-Programming.pptx
PDF
02 - Data Types and Expressions using C.pdf
PPTX
operators and control statements in c language
PDF
OOP UNIT 1_removed ppt explaining object.pdf
PPTX
Variables, Data Types, Operator & Expression in c in detail
PPTX
Operators expressions-and-statements
PDF
CP Handout#3
DOCX
C# language basics (Visual Studio)
DOCX
C# language basics (Visual studio)
PPTX
Java Operators with Simple introduction.pptx
Lecture 2
Operators & Casts
3 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp01
03. operators and-expressions
03. Operators Expressions and statements
02 iec t1_s1_oo_ps_session_02
C# 101: Intro to Programming with C#
03 Operators and expressions
C sharp part 001
Module2.2_Operators-in-C-Programming.pptx
02 - Data Types and Expressions using C.pdf
operators and control statements in c language
OOP UNIT 1_removed ppt explaining object.pdf
Variables, Data Types, Operator & Expression in c in detail
Operators expressions-and-statements
CP Handout#3
C# language basics (Visual Studio)
C# language basics (Visual studio)
Java Operators with Simple introduction.pptx

More from Tuan Ngo (20)

PDF
Introduction of cg program for portal 20120424 en
PDF
Net framework
PDF
15 anonymous methods, partial types and nullable types
PDF
14 generics and iterators
PDF
13 collections
PDF
11 exception handling
PDF
12 events and delegates
PDF
9 properties & indexers
PDF
10 namespace
PDF
8 abstract classes and interfaces
PDF
7 inheritance and polymorphism
PDF
5 arrays
PDF
6 class and methods
PDF
4 c# programming constructs
PDF
1 get started with c#
PDF
2 variables and data types
PDF
Jdbc 7
PDF
Jdbc 6
PDF
Jdbc 3
PDF
Jdbc 2
Introduction of cg program for portal 20120424 en
Net framework
15 anonymous methods, partial types and nullable types
14 generics and iterators
13 collections
11 exception handling
12 events and delegates
9 properties & indexers
10 namespace
8 abstract classes and interfaces
7 inheritance and polymorphism
5 arrays
6 class and methods
4 c# programming constructs
1 get started with c#
2 variables and data types
Jdbc 7
Jdbc 6
Jdbc 3
Jdbc 2

Recently uploaded (20)

PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
cuic standard and advanced reporting.pdf
PPT
Teaching material agriculture food technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Empathic Computing: Creating Shared Understanding
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Per capita expenditure prediction using model stacking based on satellite ima...
Building Integrated photovoltaic BIPV_UPV.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
cuic standard and advanced reporting.pdf
Teaching material agriculture food technology
Review of recent advances in non-invasive hemoglobin estimation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Empathic Computing: Creating Shared Understanding
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
The AUB Centre for AI in Media Proposal.docx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Machine learning based COVID-19 study performance prediction
Network Security Unit 5.pdf for BCA BBA.
Big Data Technologies - Introduction.pptx
NewMind AI Monthly Chronicles - July 2025

3 statements and operators

  • 1. Statements and Expressions Programming in C# tnngo2@gmail.com
  • 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
  • 4. Types of Operators Arithmetic Relational Logical Conditional Increment and Decrement Assignment
  • 5. Arithmetic Operators are binary operators.
  • 7. Logical Operators Boolean Logical Operators Bitwise Logical Operators
  • 8. Bitwise Logical Operators Boolean Logical Operators http://pastebin.com/BuXr5Zxq AND
  • 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
  • 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
  • 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. Explicit typecasting using built-in method System.Convert class Convert.ToChar(float) ToString() method https://gist.github.com/2318468
  • 19. Boxing converting a value type to its reference type.
  • 20. Unboxing converting a reference type to a value type
  • 21. Boxing & Unboxing https://gist.github.com/2318516
  • 22. Question? What is the result of the following code snippets? https://gist.github.com/2318553
  • 23. Question? What is the result of the following code snippets? https://gist.github.com/2318553