Home  |  IT Zone  |  Tips / Tricks  |  Did You Know  |  Inspirational  |  Health  |  World Infos  |  Insurance  |  Universities  |  Forex  |  Mathematics  |  Illusions  |  Children Day Quotes  |  Fun / Jokes  |  Decent Quotes  |  Birthday Msgs  |  Good Morning Msgs  |  Good Night Msg  |  Husband Wife Jokes  |  Teacher Students Jokes  |  Insult Jokes  |  Love Quotes  |  Sad Quotes  |  Funny Pics  |  Be Aware  |  Articles  |  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 :

Twitter
Back To Top

facebook main

Powered by Blogger.