SlideShare a Scribd company logo
Introduction ttoo PPrrooggrraammmmiinngg 
LLeessssoonn 33
#iinncclluuddee <<iioossttrreeaamm..hh>> 
mmaaiinn (( )) 
{{ 
ccoouutt <<<< ““ WWeellccoommee ttoo VViirrttuuaall UUnniivveerrssiittyy 
““;; 
}}
VVaarriiaabbllee 
VVaarriiaabbllee X
VVaarriiaabbllee 
 PPiicc ooff tthhee mmeemmoorryy 
 2255 
 1100332233 
nnaammee 
ooff tthhee 
vvaarriiaabbllee
VVaarriiaabbllee 
VVaarriiaabbllee ssttaarrttss wwiitthh 
11.. CChhaarraacctteerr 
22.. UUnnddeerrssccoorree __ ((NNoott RReeccoommmmeennddeedd))
VVaarriiaabbllee 
 SSmmaallll ppoosstt bbooxx 
X
VVaarriiaabbllee 
VVaarriiaabbllee iiss tthhee nnaammee ooff aa llooccaattiioonn 
iinn 
tthhee mmeemmoorryy 
ee..gg.. xx== 22;;
VVaarriiaabbllee 
IInn aa pprrooggrraamm aa vvaarriiaabbllee 
hhaass:: 
11.. NNaammee 
22.. TTyyppee 
33.. SSiizzee 
44.. VVaalluuee
AAssssiiggnnmmeenntt 
OOppeerraattoorr 
== 
xx == 22 
X 2
AAssssiiggnnmmeenntt 
OOppeerraattoorr 
LL..HH..SS == RR..HH..SS.. 
XX++ 33 == yy ++ 44 WWrroonngg 
ZZ == xx ++44 
xx ++44 == ZZ WWrroonngg
XX == 1100 ;; 
XX == 3300 ;; 
X 10 
X 30
XX == XX ++ 11;; 
X 10 + 1 
= 
X 
11
DDaattaa ttyyppee 
 iinntt ii ;; -->> 
DDeeccllaarraattiioonn lliinnee 
ii
#iinncclluuddee <<iioossttrreeaamm..hh>> 
mmaaiinn (( )) 
{{ 
iinntt xx ;; 
iinntt yy ;; 
iinntt zz ;; 
xx == 1100 ;; 
yy == 2200 ;; 
zz == xx ++ yy ;; 
ccoouutt <<<< "" xx == "" ;; 
ccoouutt <<<< xx ;; 
ccoouutt <<<< "" yy == "" ;; 
ccoouutt <<<< yy ;; 
ccoouutt <<<< "" zz ==xx ++ yy == "" ;; 
ccoouutt <<<< zz ;; 
}}
iinntt xx,, yy,, zz ;; 
iinntt xx;; iinntt yy;; iinntt zz ;;
DDaattaa TTyyppeess 
11.. iinntt 
22.. sshhoorrtt 
33.. lloonngg 
44.. ffllooaatt 
55.. ddoouubbllee 
66.. cchhaarr
Arithmetic ooppeerraattoorrss 
PPlluuss ++ 
MMiinnuuss -- 
MMuullttiippllyy ** 
DDiivviiddee // 
MMoodduulluuss %%
Arithmetic ooppeerraattoorrss 
ii ++ jj 
xx ** yy 
aa // bb 
aa %% bb
%% == RReemmaaiinnddeerr 
55 %% 22 == 11 
22 %% 22 == 00
44 // 22 == 22 
55 // 22 == ??
PPrreecceeddeennccee 
 HHiigghheesstt:: (( )) 
 NNeexxtt:: ** ,, // ,, %% 
 LLoowweesstt:: ++ ,, --

More Related Content

PPT
CS201- Introduction to Programming- Lecture 07
PPT
CS201- Introduction to Programming- Lecture 27
PPT
CS201- Introduction to Programming- Lecture 30
PPT
CS201- Introduction to Programming- Lecture 10
PPT
CS201- Introduction to Programming- Lecture 06
PPT
CS201- Introduction to Programming- Lecture 26
PPT
CS201- Introduction to Programming- Lecture 23
PPT
CS201- Introduction to Programming- Lecture 09
CS201- Introduction to Programming- Lecture 07
CS201- Introduction to Programming- Lecture 27
CS201- Introduction to Programming- Lecture 30
CS201- Introduction to Programming- Lecture 10
CS201- Introduction to Programming- Lecture 06
CS201- Introduction to Programming- Lecture 26
CS201- Introduction to Programming- Lecture 23
CS201- Introduction to Programming- Lecture 09

What's hot (19)

PPT
CS201- Introduction to Programming- Lecture 36
PPT
Comparative and superlative adjectives
PPT
Comparative and superlative adjectives
PPT
CS201- Introduction to Programming- Lecture 25
PPT
CS201- Introduction to Programming- Lecture 12
PPT
CS201- Introduction to Programming- Lecture 40
PPT
CS201- Introduction to Programming- Lecture 15
PPT
CS201- Introduction to Programming- Lecture 29
PPT
CS201- Introduction to Programming- Lecture 37
PPT
Tiro parabólico
PPT
CS201- Introduction to Programming- Lecture 20
PPT
Day 8 initegrations review
PDF
Contrats speciaux du commerce maritime
PPT
Perangkat keras komputer
PPT
Hardware
PPT
pengenalan perangkat keras komputer
PPT
Perangkat Keras Hardware
PPT
Colonial America
PPT
Potential and kinetic energy
CS201- Introduction to Programming- Lecture 36
Comparative and superlative adjectives
Comparative and superlative adjectives
CS201- Introduction to Programming- Lecture 25
CS201- Introduction to Programming- Lecture 12
CS201- Introduction to Programming- Lecture 40
CS201- Introduction to Programming- Lecture 15
CS201- Introduction to Programming- Lecture 29
CS201- Introduction to Programming- Lecture 37
Tiro parabólico
CS201- Introduction to Programming- Lecture 20
Day 8 initegrations review
Contrats speciaux du commerce maritime
Perangkat keras komputer
Hardware
pengenalan perangkat keras komputer
Perangkat Keras Hardware
Colonial America
Potential and kinetic energy
Ad

Viewers also liked (20)

PPS
ENG101- English Comprehension- Lecture 23
PPS
ENG101- English Comprehension- Lecture 28
PPS
CS101- Introduction to Computing- Lecture 37
PPT
MGT101 - Financial Accounting- Lecture 40
PPS
CS101- Introduction to Computing- Lecture 32
PPS
ENG101- English Comprehension- Lecture 36
PPS
ENG101- English Comprehension- Lecture 43
PPS
ENG101- English Comprehension- Lecture 45
PPT
CS201- Introduction to Programming- Lecture 34
PPT
MGT101 - Financial Accounting- Lecture 30
PDF
PAK301- Pakistan Studies- Lecture 27
PPT
MGT101 - Financial Accounting- Lecture 38
PPT
CS201- Introduction to Programming- Lecture 35
PPT
MGT101 - Financial Accounting- Lecture 44
PPT
CS201- Introduction to Programming- Lecture 33
PPS
CS101- Introduction to Computing- Lecture 29
PPS
CS101- Introduction to Computing- Lecture 44
PPS
ENG101- English Comprehension- Lecture 24
PPT
CS201- Introduction to Programming- Lecture 22
PPT
CS201- Introduction to Programming- Lecture 08
ENG101- English Comprehension- Lecture 23
ENG101- English Comprehension- Lecture 28
CS101- Introduction to Computing- Lecture 37
MGT101 - Financial Accounting- Lecture 40
CS101- Introduction to Computing- Lecture 32
ENG101- English Comprehension- Lecture 36
ENG101- English Comprehension- Lecture 43
ENG101- English Comprehension- Lecture 45
CS201- Introduction to Programming- Lecture 34
MGT101 - Financial Accounting- Lecture 30
PAK301- Pakistan Studies- Lecture 27
MGT101 - Financial Accounting- Lecture 38
CS201- Introduction to Programming- Lecture 35
MGT101 - Financial Accounting- Lecture 44
CS201- Introduction to Programming- Lecture 33
CS101- Introduction to Computing- Lecture 29
CS101- Introduction to Computing- Lecture 44
ENG101- English Comprehension- Lecture 24
CS201- Introduction to Programming- Lecture 22
CS201- Introduction to Programming- Lecture 08
Ad

Similar to CS201- Introduction to Programming- Lecture 03 (20)

PPT
CS201- Introduction to Programming- Lecture 11
PPT
CS201- Introduction to Programming- Lecture 13
PPT
CS201- Introduction to Programming- Lecture 04
PPT
CS201- Introduction to Programming- Lecture 32
PPT
CS201- Introduction to Programming- Lecture 24
PPT
CS201- Introduction to Programming- Lecture 14
PPT
CS201- Introduction to Programming- Lecture 16
PPT
Solving linear equations (chapter 2)
PPT
CS201- Introduction to Programming- Lecture 21
PPT
21 High-quality programming code construction part-ii
PPT
Microsoft excel 2
PPT
19 Algorithms and complexity
PPT
Factorización de ecuaciones cuadráticas
PPT
CS201- Introduction to Programming- Lecture 44
PPT
CS201- Introduction to Programming- Lecture 31
PPT
CS201- Introduction to Programming- Lecture 45
PPT
System of linear equation by Graphical Method
PPT
CS201- Introduction to Programming- Lecture 38
PPT
CS201- Introduction to Programming- Lecture 42
CS201- Introduction to Programming- Lecture 11
CS201- Introduction to Programming- Lecture 13
CS201- Introduction to Programming- Lecture 04
CS201- Introduction to Programming- Lecture 32
CS201- Introduction to Programming- Lecture 24
CS201- Introduction to Programming- Lecture 14
CS201- Introduction to Programming- Lecture 16
Solving linear equations (chapter 2)
CS201- Introduction to Programming- Lecture 21
21 High-quality programming code construction part-ii
Microsoft excel 2
19 Algorithms and complexity
Factorización de ecuaciones cuadráticas
CS201- Introduction to Programming- Lecture 44
CS201- Introduction to Programming- Lecture 31
CS201- Introduction to Programming- Lecture 45
System of linear equation by Graphical Method
CS201- Introduction to Programming- Lecture 38
CS201- Introduction to Programming- Lecture 42

More from Bilal Ahmed (7)

PPT
CS201- Introduction to Programming- Lecture 43
PPT
CS201- Introduction to Programming- Lecture 41
PPT
CS201- Introduction to Programming- Lecture 39
PPT
CS201- Introduction to Programming- Lecture 28
PPT
CS201- Introduction to Programming- Lecture 19
PPT
CS201- Introduction to Programming- Lecture 18
PPT
CS201- Introduction to Programming- Lecture 17
CS201- Introduction to Programming- Lecture 43
CS201- Introduction to Programming- Lecture 41
CS201- Introduction to Programming- Lecture 39
CS201- Introduction to Programming- Lecture 28
CS201- Introduction to Programming- Lecture 19
CS201- Introduction to Programming- Lecture 18
CS201- Introduction to Programming- Lecture 17

CS201- Introduction to Programming- Lecture 03