Computer Science, asked by sonijaiswal882, 3 months ago

Wel. Then add ay at the last
b. Write a program in Qbasic to display the following pattern
1
21
321
4321
54321​

Answers

Answered by anindyaadhikari13
3

Solution:

1. Using 2 loops, the co‎de goes like -

CLS

FOR I = 1 TO 5

   FOR J = I TO 1 STEP -1

       PRINT J;

   NEXT J

   PRINT

NEXT I

END

2. Using 1 loop, the co‎de goes like -

CLS

LET A = 1

LET B = 2

FOR I = 1 TO 5

   PRINT A

   A = A + ((I + 1) * 10 ^ I)

NEXT I

END

See the attachments for output.

•••♪

Attachments:
Answered by BrainlyProgrammer
3

Answer:

CLS

FOR I=1 TO 5

FOR J= I TO 1 STEP -1

PRINT J

NEXT J

PRINT

NEXT I

END

Similar questions