Ask Question
14 August, 08:54

What is the output of code corresponding to the following pseudocode?

Declare A As Integer

Declare B As Float

Set A = 2

While < = 3

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

+4
Answers (1)
  1. 14 August, 10:34
    0
    B

    Explanation:

    The while statement has a typo. It should be While A < = 3

    So A goes through the values 2 and 3.

    For the value A=2, the program prints 5 and 5

    For the value A=3, the program prints 7.5 and 7, where 7 is the truncated version of 7.5.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What is the output of code corresponding to the following pseudocode? Declare A As Integer Declare B As Float Set A = 2 While < = 3 Set B = ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers