Ask Question
22 April, 03:37

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

+1
Answers (1)
  1. 22 April, 03:47
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers