2. Data Types Variables Operators
2. Data Types Variables Operators
Prepared by:
LEE-MAR
Instructor I
M. ARCON
E-mail Address: [email protected]
Mobile Number: +639511177784
Bachelor
ITC 121 : COMPUTER PROGRAMMING 2 of Science in
College of
College of
Computer
Computer Learning Objectives
Click to edit
Studies
Studies Master title style
underscore(_).
ITC 121 : COMPUTER PROGRAMMING 2 TOPIC: DATA TYPES, VARIABLES, OPERATORS
College of
College of
Computer
Computer VARIABLES
Click to edit
Studies
Studies Master title style
Can begin with a letter (a-z, A-Z) or underscore(_)
Variable names are case-sensitive
It cannot be a keyword or a reserve word in C#.
Example of keywords:
bool
class
while
string
It should be descriptive and meaningful.
Whitespace is not allowed.
ITC 121 : COMPUTER PROGRAMMING 2 TOPIC: DATA TYPES, VARIABLES, OPERATORS
College of
College of
Computer
Computer VARIABLES
Click to edit
Studies
Studies Master title style
age float
totalPrice 2talPrice
_name @name
student3 skjbfdsjkf
Constant
a constant variable is a variable whose value
cannot be changed after it has been initialized or
defined. Once a constant variable is assigned a value,
that value remains constant throughout the program's
execution. Constant variables are often used to
represent values that are not expected to change, such
as mathematical constants (e.g., pi).
ITC 121 : COMPUTER PROGRAMMING 2 TOPIC: DATA TYPES, VARIABLES, OPERATORS
College of
College of
Computer
Computer OPERATORS
Click to edit
Studies
Studies Master title style
Operator is a symbol that tells the compiler or interpreter to perform
specific mathematical, relational or logical operation and produce final
result.
Arithmetic operators (/, *, +, -, %)
Unary operator (--, ++, !)
Comparison Operators (<, <=, >, >=)
Assignment Operators (=, +=, -=, /=, %=, *=)
Logical Operator (&&, ||)
Equality Operator (==, !=)
ITC 121 : COMPUTER PROGRAMMING 2 TOPIC: DATA TYPES, VARIABLES, OPERATORS