Computer Science, asked by provati68, 16 hours ago

Qbasic program to print the following series using loops:
1
2*3
4*5*6
7*8*9*0

Answers

Answered by anindyaadhikari13
3

Correct Question.

QBASIC program to print the following pattern using loops:

1

2 * 3

4 * 5 * 6

7 * 8 * 9 * 0

The Co‎‎de.

CLS

ROWS = 4

A = 1

FOR I = 1 TO ROWS

   FOR J = 1 TO 2 * I - 1

       IF J MOD 2 = 1 THEN

           PRINT A MOD 10;

           A = A + 1

       ELSE

           PRINT "*";

       END IF

   NEXT J

   PRINT

NEXT I

END

Output.

1

2 * 3

4 * 5 * 6

7 * 8 * 9 * 0

See attachment for output.

Attachments:
Similar questions