To Display Series from 1 to 10 (FUNCTION Procedure) - QBasic

To Display Series from 1 to 10 (using FUNCTION Procedure) - QBasic
  • Without using parameter
  • DECLARE FUNCTION series ()
    CLS
    s = series
    END

    FUNCTION series
    FOR i = 1 TO 10
        PRINT i
    NEXT i
    END FUNCTION
  • Using parameter
  • DECLARE FUNCTION series(a)
    CLS
    FOR i = 1 TO 10
        PRINT series(a);
    NEXT i
    END

    FUNCTION series (a)
    a = a + 1
    series = a
    END FUNCTION

Share :

Facebook Twitter Google+
Back To Top

facebook main

counter

Powered by Blogger.