Professional Documents
Culture Documents
Lecture outline
1. Variables
Naming Features of variables
2. Operators
Assignment Operators Arithmetic Operators Precedence
3. Data Types
Int Char Float
Welcome
Variable
Variable
Variable
Pic of the memory 25
10323
Components of Computer
Language hierarchy
Small post box
Variable
e.g. x= 2;
Variable
Assignment operator
=
x=2
X
2
International Islamic University, Islamabad
Assignment operator
L.H.S = R.H.S.
X+ 3 = y + 4 Wrong
Z = x +4
x +4 = Z
Wrong
Assignment operator
X = 10 ;
X = 30 ;
X X
10 30
X = X + 1;
10
+ 1
= 11
X
International Islamic University, Islamabad
Data type
i
International Islamic University, Islamabad
Data Types
1. 2. 3. 4. 5. 6.
Arithmetic operators
+ * / %
Arithmetic operators
% = Remainder
5%2=1 2%2=0
4/2=2 5/2=?
Precedence
() *,/,% +,-
Questions