QBASIC Program 1: To generate the given Triangular Series.

Program to generate the pattern:

1
2 6
3 7 10
4 8 11 13
5 9 12 14 15

CLS
x = 5
y = 5
a = 1
FOR i = 5 TO 1 STEP -1
p = x
q = y
FOR j = 1 TO i
LOCATE p, q
PRINT a
a = a + 1
p = p + 1
NEXT j
x = x + 1
y = y + 3
PRINT
NEXT i
END


One Response to QBASIC Program 1: To generate the given Triangular Series.

  1. Avatar Waylife
    Waylife says:

    Is there any other logic to solve without the use of locate function??