Overview of C#
Programming
Pakorn Weecharungsan
Contents
 Overview of C#
 Variables
 Expressions and Operators
 Statements
 Arrays
 Classes and Methods
Overview of C# - A Simple C#
Program
Overview of C# - A Simple C#
Program
 Line 1 บอก Compiler ให้ทราบว่าโปรแกรมนี้มี
การใช้System namespace
 Line 3 ประกาศ namespace ที่มีชื่อว่า Simple
 Line 5 สร้าง class ที่มีชื่อว่า Program
 Line 7 สร้าง method ที่มีชื่อว่า Main
 Line 9 แสดงข้อความ “Hi There!” ออกทาง
จอภาพ
Overview of C# - Identifiers and
Keywords
Overview of C# - Identifiers and
Keywords
Overview of C# - Text Output from
a Program
 Write
 WriteLine
Overview of C# - The Format String
 Format
 Example
Overview of C# - Comments
Variables – Simple Types
Variables – Simple Types
Variables – Declarations
Variables – Initializers
Variables – Multiple Declarations
Expressions and Operators –
Simple Arithmetic Operators
 The Simple Arithmetic Operators
 Example
Expressions and Operators – The
Remainder Operator
 The Remainder Operator
 Example
Expressions and Operators – Rational
and Equality Comparison Operators
Expressions and Operators – Rational
and Equality Comparison Operators
Expressions and Operators –
Increment and Decrement Operators
Expressions and Operators –
Increment and Decrement Operators
Expressions and Operators –
Conditional Logical Operators
Expressions and Operators –
Conditional Logical Operators
Expressions and Operators –
Assignment Operators
Expressions and Operators –
Assignment Operators
Expressions and Operators – The
Conditional Operators
Expressions and Operators – The
Conditional Operators
Expressions and Operators – The
Conditional Operators
Expressions and Operators – The
Conditional Operators
Expressions and Operators –
Unary Arithmetic Operators
Statements – Flow of Control
 Conditional statements
 if
 if…else
 switch
 Looping statements
 while
 do
 for
 foreach
 Jump statements
 break
 continue
 return
 goto
 throw
Statements – The if Statements
Statements – The if…else
Statements
Statements – The switch
Statements
Statements – The switch
Statements
Statements – The switch
Statements
Statements – The switch
Statements
Statements – The switch
Statements
Statements – The switch
Statements
Statements – The while Loop
Statements – The while Loop
Statements – The do Loop
Statements – The do Loop
Statements – The for Loop
Statements – The for Loop
Statements – The for Loop
Statements – The for Loop
Statements – The break Statement
 for
 foreach
 while
 do
Statements – The continue
Statement
 while
 do
 for
 foreach
Statements – The using Statement
Statements – The using Statement
Arrays
Arrays – Accessing Array Elements

D1 Overview of C# programming