To generate the series, 1, 3, 6, 10, 15 ….. upto 10th term. (Qbasic Code)

To generate the series, 1, 3, 6, 10, 15 ….. upto 10th term.
  • CLS
    a = 1
    b = 2
    FOR i = 1 TO 10
        PRINT a;
        a = a + b
        b = b + 1
    NEXT i
    END
Next Method 
  • CLS
    s = 0
    FOR i = 1 TO 10
        s = s + i
        PRINT s;
    NEXT i
    END

Share :

Facebook Twitter Google+
Back To Top

facebook main

counter

Powered by Blogger.