1 what is the output of code corresponding to the following pseudocode declare a as 5346745
-
1. What is the output of code corresponding to the following pseudocode?
Declare A As Integer
Declare B As Float
Set A = 2
While
Set B = 2.5 * A
Write B
Set B = Int(B)
Write B
Set A = A + 1
End While
Answer
A. 5,7 B. 5,5,7.5,7 C. 5,5,7,7 D. 2,5,3,7
-
2. What is the output of the code corresponding to the pseudocode shown?
Declare G As Integer
Declare H As Integer
Set G = 7
While G
Set H = 6
While H
Write G + H
Set H + H + 1
End While(H)
Set G = G + 1
End While(G)
Answer
A. 13,14,15 B. 7,6,7,8 C. 76,77,86,87 D. 13,14,14,15
-
3. What will be displayed after code corresponding to the following pseudocode is run?
Declare A As Integer
Declare B As Integer
Declare C As Integer
Set A = 3
While A
Set B = (2 * A) – 1
Write B
Set C = A
While C
Write C
Set C = C + 1
End While(C)
Set A = A + 2
End While(A)
Answer
A. 5,3,9,5 B. 3,5,4,5,9,5 C. 5,3,4,9,5,6 D. 5,3,3,9,5,5
-
. What does the following program segment do?
Declare Count As Integer
Declare Sum As Integer
Set Sum = 0
For (Count = 1; Count
Set Sum = Sum + Count
End For Answer
A. It sums all the integers from 0 through 50 B. It sums all the integers from 1 through 50 C. It sums all the integers from 1 through 49 D. It does nothing since there is no Write statement