Results 1 to 2 of 2

Thread: How to create factorial of numbers using sub procedure in vbscript

  1. #1
    Join Date
    Feb 2012
    Posts
    1

    question How to create factorial of numbers using sub procedure in vbscript

    Please anyone tell me how can I print factorial of n numbers using subroutine in vbscript.

    I have found this code somewhere but its not working

    <html>
    <head>
    <script language="vbscript">
    num=inputbox("Enter a number")
    Sub fact
    fact=fact*k
    Document.write("Factorial of " & num & " = " & Fact)
    End sub
    </script>
    </head>
    <body>
    <script language="vbscript">
    fact
    Call fact
    </script>


    Please anyone help fast
    Last edited by Gurseerat; 04-02-2012 at 02:32 AM.

  2. #2
    Join Date
    May 2009
    Posts
    543

    Re: How to create factorial of numbers using sub procedure in vbscript

    you are not passing the parameter to that perticular subprocedure. you must try to make use of Parametrized subprocdure.

    Syntex for creating such parameterized subprocedure in VBScript is follow:

    Sub mysub(argument1,argument2)
    your statements
    End Sub
    May this will help

Similar Threads

  1. How to create ZIP Files from Command-Line via VBScript?
    By FB in forum Windows Server Help
    Replies: 10
    Last Post: 22-12-2011, 12:18 AM
  2. How to create procedures in VBScript
    By Betelgeuse in forum Software Development
    Replies: 4
    Last Post: 30-11-2010, 01:45 AM
  3. How to create Functions in VBScript?
    By NIcaBoy in forum Software Development
    Replies: 4
    Last Post: 29-01-2010, 09:42 PM
  4. Procedure to create a PPS file
    By Sarfaraj Khan in forum Windows Software
    Replies: 5
    Last Post: 11-01-2010, 02:16 PM
  5. how to create automatic self extracting zip file in vbscript
    By vivekmohan in forum Software Development
    Replies: 1
    Last Post: 03-09-2009, 09:10 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,670,376.81967 seconds with 17 queries