Qbasic program to print the following series using loops:
1
2*3
4*5*6
7*8*9*0
Answers
Answered by
3
Correct Question.
QBASIC program to print the following pattern using loops:
1
2 * 3
4 * 5 * 6
7 * 8 * 9 * 0
The Code.
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
NEXT I
END
Output.
1
2 * 3
4 * 5 * 6
7 * 8 * 9 * 0
See attachment for output.
Attachments:
Similar questions
Political Science,
8 hours ago
Biology,
8 hours ago
English,
8 hours ago
Computer Science,
16 hours ago
Physics,
7 months ago
Computer Science,
7 months ago
Math,
7 months ago