Home  |  IT Zone  | Practice ZoneTips / Tricks  |  Did You Know  |  Inspirational  |  Health  |  Insurance  |  Universities  |  Forex  |  Mathematics  |  Illusions  |  Children Day Quotes  |  Be Aware  |  Articles  | Funny Pics | Entertainment | Songs | Simple Joys of Life |

To find the factorial of given number using SUB Procedure. (Qbasic Code)

To find the factorial of given number using SUB Procedure. (Qbasic Code)
  • DECLARE SUB factorial (n)
    CLS
    INPUT "Enter a number"; n
    CALL factorial (n)
    END

    SUB factorial (n)
    f = 1
    FOR i = 1 TO n
        f = f * i
    NEXT i
    PRINT "The factorial of input number is"; f
    END SUB

Share :

X
Back To Top

facebook main

Powered by Blogger.