Februar
y
4
Monday
9
L
ectur
e
body
I
I ⇒”p
is
to !¥
.
. ..
..
=÷Howmanytimesis5″chedced?↳
be
:
lol times ↳ too
/ How many times
DIE, executed ?
for . Loop
TTyIegI xa
‘
: ?o
:
”
1⇒@€
Beg
• Tracings
How many times How many times
” checked ?
:& ?¥i÷I
is ” Kbo
is ‘ ‘ prntlnc
.
.-
”
S executed ?
,
loop .
100
oo@0ILAeo.aa
0F 99
→
–
for ⇒
Loop
:
end
Alternative ,
Syntax
‘The It
–
–
So the above for loop may be re-written as
=
Tnt I O’s
s Istoo} ){
:
for (
printIn(” ” );
It t ; }
–
-.-
axon
.
.
for Loop
Exercise I
CD
Eaten t.es#
I:I OFc@4-⇒D#⇒E08o;fI
:
-1
¥4
T
3¥11 2ft
t 41I⇒9n
=
0
I slag
2dIteE
Cos99] a y
..
⇐
Gynt
lead T
Gunt=2*4 → count counts 100 count a
] igapigggz.IE?BDb0
Els
335
–
—
‘ s
I:t* .
,
.
for Loop :
Exercise
(
too
§y 694
⇐I Are the outputs same
Eosa4
O
or different ? # of iterations : 100
[ Welke
[lsl 100
–
Welcome
.–
W w! e ”
W!%whef
.-
for Loop : Exercise –
(3)
. KA⇒a⇒IAte
five
I
as
8?
⇒ ¥÷÷÷÷H÷
.
5 54=5 T
66 6<= 5
6 F
while -
Loop :
flow chart
and ten
&
while ( ) -
#
and" "
if TETLEY
X
-
-
t
Dwyer
stay naaluatesaff
for C
-
s-s
-
)
→ How many times is " k lo o
"
checked ?
→ How many times is " printInc . . - S" executed ?
B-¥O8%B- •
.:
Loop E3
102 ]
-
102 3 t I
while
•
I
•
O
How many times is " Kbo How many times
Tracing
,
-
* eat ,
ons
89e
- -
Heaton
.
" checked ?
is ''prntlnc. . - I" executed?
y
2
-
I
co
=
•
-
while Loop :
Exercise CD
"
9DO• EIlstad
] pound
I Iteration I count count c 100 count
soo count
times ⇐ 100
Ci ) Iteration
0,99 E I
→
→
o Are the
-
Loop :
Exercise
(2)
Welcome
-
..
O
I
wA h i l e
outputs
different ?
-
Welcome
- ..
I
same
or
-
2X count t
2
radius =⇒#-±8
radius value .
neg
Compound
Loop
:
Exercise CD
=t -
2
,
f¥s
-
Test I :
Test 2
radars
Test 3
radius - 2
Error
:
:
:
count
Gunt - Gunt t-
-
=3