Flowchart/pseudo code work sheet2
Choose the correct answer for each of the following questions:
No. Question Choice 1 Choice 2 Choice 3 Choice 4
10. The error in the following flowchart is: The symbol The symbol The symbol No error
used for the used for the used for
start input y=y+3
statement statement
11. What are the suitable words to be filled in the blanks so that 2. 10 2. 10 2. 20 2. 10
the following pseudo code will: 3. x 3. 10 3. x 3. x
Print the even numbers between 10 and 20. 4. 2 4. 2 4. 2 4. 1
1. Start 5. <= , step 3 5. <= , step 3 5.>= , step 3 5.< ,step 2
2. x = _______
3. Print ______
4. x = x +_____
5. if x___ 20 then goto _____
6. Stop
12. Which one of the following pseudo codes solve the following 1.Start 1.Start 1.Start None of
problem: 2.x=10 2.x=1 2.x=10 them
3.Print x 3.Print x 3.Print x
Printing numbers from 10 to 1 in descending order 4.x=x-1 4.x=x-1 4.x=x+1
5.If x>=1 5.If x<=10 5.If x<=1
then goto 3 then goto 3 then goto 3
6.Stop 6.Stop 6.Stop
13. What is the output for the following flow chart: 2 10 2 8 No output None of
them
1
14. What is the output for the following code: 8 5 4 1 2 8 5 6 None of
them
Assume that the inputs are: 4, 1, 2, 3
1. Start
2. a = 4
3. Input x
4. If a mod x = 0 then goto 6
5. goto 9
6. x= x + a
7. print x
8. goto 3
9. Stop
15. What is the output for the following flowchart? 13 9 12 7 9 12 9 13 7
Assume that the inputs are:
13 9 12 7
2
16. Write the equivalent Pseudo Code for the following flowchart 1. Start 1. Start 1. Start None of
2. Let x=8, 2. Let x=8, 2. Let x=8, them
y= 12 y= 12 y=12
3. If x+y>10 3. If x+y > 10 3. If x+y> 10
then then then
a) a) decrement decrement y
decrement y y by 10 by 10
by 10 b) print x, y else
b)print x, y else Increment x
4. Increment Increment x by 2
x by 2 by 2 4. print x, y
5. If x-y<>2 4. If x-y<>2 5. If x-y<>2
then then then
print “Test” print “Test” print “Test”
6. Stop 5. Stop 6. Stop
17. What is the output for the following flowchart: 2 4 5 8 5 8 2 4 5 8 None of
them
3
18. The equivalent Pseudo Code for the flowchart in question 17 1. Start 1. Start 1. Start None of
is: 2. let n=2, 2. let n=2, m=4 2. let n= 2, them
m=4 3. Print n, m m=4
3. Print n, m 4.Increment n 3. print n, m
4.Increment n by 3 4.Increment n
by 3 5.If n<=4 then by 3
5.If n<=4 then goto step 3 5.If n<=4 then
print n, m 6. Increment m increment m
6.Increment m by 4 by 4
by 4 7. Print n, m 6.Print n, m
7.Print n, m 8. Stop 7. Stop
8. Stop
19. What is the output for the following Pseudo code? 0 1 2 0 0 0 2 1 0 0 2 1
1. Let x=24
2. Calculate: y = x mod 3
3. decrement x by 1
4. Print y
5. If x>=22 then goto step 2 else Stop
20. What is the output for the following flowchart: 6 4 5 7 6 8 None of
Assume that c= 15: them
4
5