Professional Documents
Culture Documents
0140495
Section No:
4
Student ID:
Student Name:
________________________________________________________________________________________
Choose the correct answer for each of the following questions:
1. Which of the following is not a data type?
a. Text
b. Integer
c. Boolean
d. String
b. 3 = C
c. C = C + 4
d. C = X
b. 2
c. 3
d. 7
b. 3
c. 7
d. 25.5
b. 1
c. True
d. False
b. True
c. 5
d. -1
Start
Let c = 8
If c > 2 then go to step 5
Go to step 8
print c
Decrement c by 2
Go to step 3
Stop
8 6
b. 8 6 4
c. 8 6 4 2
1
d. 8
c.
b.
d.
a. 11 9 11
10.
b. 7 9 12
c. 11 9 12
d. 7 9 11
a. 1. Start
2. Let x = 7, y =
12
3. If x < y then
Print y-1 else Print
x
4. If y <> 11 then
Increment x by 2
5. Print x, y
6. Stop
b. 1. Start
2. Input x, y
3. If x < y then
Print y-1 else
Print x
4. If y <> 11
then Increment x
by 2
5. Print x, y
6. Stop
c. 1. Start
2. Let x = 7, y =
12
3. If x < y then
Print y-1
4. Print x
5. If y <> 11
then Increment x
by 2
6. Print x, y
7. Stop
2
d. 1. Start
2. Let x = 7, y =
12
3. If x < y then
Print y-1 else Print
x
4. If y <> 11 then
Increment x by 2
else Print x, y
5. Stop
11.
a. 3
12.
b. 6
c. 8
d. 123
What is the equivalent Pseudo Code for the flowchart in question 11?
a.
2.
3.
4.
5.
1. Start
Let x = 3
Let f = 1
Let i = 1
If i <=x then
Print f
Stop
6. f = f * i
7. Increment i by
1
b.
2.
3.
4.
5.
1. Start
Let x = 3
Let f = 1
Let i = 1
If i <=x then
f=f*i
Increment i
by 1
6. Print f
7. Stop
c.
2.
3.
4.
5.
1. Start
Let x = 3
Let f = 1
Let i = 1
If i <=x then
f=f*i
Increment i
by 1
Go to 5
6. Print f
7. Stop
d.
2.
3.
4.
5.
1. Start
Let x = 3
Let f = 1
Let i = 1
If i <=x then
f=f*i
Increment i by
1
Go to 4
6. Print f
7. Stop
13. Which of the following pseudo code will read a number and then print
whether its a positive or a negative number?
a. 1. Input x
2. if x >= 0 then
Print x is
positive
3. Print x is
negative
b. 1. Input x
2. if x <= 0
then Print x is
negative
3. Print x is
positive
c.1. Input x
2. if x >= 0
then Print x is
positive else
Print x is
negative
3
d. None of them
14. What are the suitable words to be filled in the blanks so that the
following pseudo code will print the result of 2^4?
1.
2.
3.
4.
5.
6.
7.
a.
15.
Start
______ , count =0
Mul = Mul*2
count= count+1
If count<4 then _____
Print Mul
Stop
2. Mul = 1
b. 2. Mul = 0
5. goto 3
5. goto 3
c. 2. Mul = 1
5. goto 2
d. 2. Mul = 1
5. Mul = Mul * 2
a. ***
b. ***
###
###
***
c. ***
###
***
d. ***
###
***
***