Computer Science, asked by saifullah25, 2 months ago

A=1
DO WHILE A<= 10
PRINT A
A=A+3
LOOP
PRINT A
END

Answers

Answered by anindyaadhikari13
1

Required Answer:-

Given Cσde:

A = 1

DO WHILE A <= 10

   PRINT A

   A = A + 3

LOOP

PRINT A

END

To Find:

  • Output (QBASIC)

Output:

1

4

7

10

13

Explanation:

The given loop iterates if A <=10 is true.

\boxed{\begin{array}{c|c}\tt A:&amp;\tt Is\: A \leq 10?\\ \sf1&amp;\sf True\\ \sf4&amp;\sf True\\ \sf7 &amp;\sf True\\ \sf10&amp;\sf True\\ \sf13&amp;\sf False\end{array}}

Now, as soon as the condition becomes false, the loop is terminated.

Again, value of A is printed (Line 6).

So, the output goes like -

1

4

7

10

13

•••♪

Attachments:
Similar questions