Flowcharts&Pseudocodes Fund
Flowcharts&Pseudocodes Fund
a. 1 2 3 4 5 6 7
b. 1 2 4 5 7
c. 1 2 3 4 5 6
d. infinite loop
Q2) What is the output of the following flowchart ?
a. 5 11 7
b. infinite loop
c. 5 11 18 7
d. 5 6 7 7
Q3) The following pseudocode reads 5 numbers and print the summation of
positive numbers only, find the wrong step if exist.
1. start
2. sum = 0, c = 1
3. input x
4. if x > 0 then sum = sum + x
5. c = c + 1
6. if x < 5 goto step 3
7. print sum
8. stop
a. step 4
b. step 6
c. step 7
d. the pseudocode is correct
a. 3 5 9 $
b. 6 10 18 $
c. 9 25 81 $ $ $
d. 9 25 81 $
Q6) The output of the following pseudocode is :
1. start
2. x = 8, y = 9
3. if (x > 10) then goto 5
4. if (x <= 8) then goto 7
5. y = y - 2
6. goto 8
7. y = y * 2
8. print y
9. y = x
10. end
a. 18
b. 16
c. 8
d. 14
Q7) The following flowchart used to find the maximum number between the
three given numbers a, b, c, fill the blank shapes with suitable steps :
a. 1. Start
2. n = 1, m = 5
3. print m + n
4. increment n by 2
5. if n < =m then goto 3
6. print m, n
7. stop
b. 1. Start c. 1. Start
2. n = 1, m = 5 2. n = 1, m = 5
3. print m + n 3. print m + n
4. if n <= m then goto 3 4. increment n by 2
5. increment m by 2 5. if n <= m then goto 3
6. print m, n else increment m by 2
7. stop 6. print m, n
7. stop
Q9) An outline of the logic of the program you will write :
a) Pseudocode
b) Flowcharts
c) None of the above
a. 3
b. 12
c. 6
d. 5
Q13) The following pseudocode finds and prints the odd numbers between 1
and 15, find the wrong step if exist.
1. start
2. j = 1
3. if j <= 15 then goto 7
4. if j mod 2 <> 0 then print j
5. j = j + 1
6. goto step 3
7. end
a. 1
b. 5
c. 2
d. 4
Q15) The following pseudocode finds the summation of the even numbers
between 2 to 100, find the wrong statement in the following pseudocode if
exist :
1. start
2. let sum = 0
3. let x = 2
4. sum = sum + x
5. x = x + 2
6. if x <= 100 then goto step 4
7. print sum
8. end
a. 5
b. 4
c. 18
d. 15
Q17) Find the output of the following flowchart, assume that
c = 15
1 b 10 b
2 c 11 a
3 b 12 b
4 d 13 d
5 d 14 d
6 a 15 b
7 b 16 a
8 c 17 c
9 a