Upload
rifa-farhad
View
216
Download
0
Embed Size (px)
DESCRIPTION
This was given as course material to help to learn flowchart tracing
Citation preview
Trace for n=20 & 53, 52
1. Trace the following flowchart for input 112. Trace the following flowchart for input 20
3. Trace the following flowchart for input 21
4. Trace the following flowchart for input 20
5. Trace the flowchart for the following inputs:a. 0b. 2c. 31
6. Trace the following flowchart for input 56096
7. Trace the following flowchart for the given input.
No
Yes
NO
Yes
Input I = 3;
Input J = 5;
8. Trace the following flowchart for the given input
Yes
No
Yes
No
Input S = 41237
Input P = 2
[N.B Here (%) means Mod. Ex. = 11%10 = 1]9. Trace the following flowchart for input n=20 & 53, 52
End
T
r=r*10
C=C-1
F
F
Print r
C>0
p>0
F
T=p % 10
p=p/10
r=10*r+T
T
T
n>0
F
T=n % 2
n=n/2
p=10*p+T
C=C+1
n=n/2
T
T=0
T=n % 2
Read n
C=0
P=0
R=0
Start
Stop
If D>1
D = D - 1
Print J
J = 2*D
If P > 1
S = S / 10
P = P - 1
Input S
Input P
D = S % 10
Set J = 0,
D = 0
Start
Stop
J = j-1
Print I*J
I = I-1
If J > 0
If I > 0
Read J
Read I
Start
No
Stop
Display d
Yes
num = num / 10
num > 0?
num = num d
d = num % 10
Input NumerGet num
Start
End
Print age, is old age
No
Yes
No
Yes
year < age
Print age, is young age
year=year+1
old=0
age%year =0
?
old=1, year=3
Read age
Start
End
I = I+ 2
Output I
When IN
I = 1
Input N
Start
End
Ftemp=F
F = F1
F1 = F1+Ftemp
Output F
When F