Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Dec 14th, 2006, 4:20 PM   #1
dwizzle13
Newbie
 
Join Date: Oct 2006
Posts: 19
Rep Power: 0 dwizzle13 is on a distinguished road
Question Help - Get the product of the numbers between 1 and n?

How can I change this code to get the product of the numbers between 1 and a variable n. Here's the code, and I can just get the n's square.

    Function product(ByVal n As Double, ByRef i As Double)
        Dim a As Double
        For i = 1 To n
            a = n * i
        Next
        Return a
    End Function

Thanks.
dwizzle13 is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CGI Script - change product display jess Perl 3 Jul 12th, 2006 5:25 PM
Median/Mode in arrays? {Need help} Java|Tera Java 27 Nov 29th, 2005 10:50 AM
Reading in multiple numbers wingz198 C++ 2 Oct 14th, 2005 1:45 PM
Prime Numbers Konnor C++ 6 Sep 12th, 2005 6:46 PM
Assignment of numbers to variables without asking Haz C# 26 May 23rd, 2005 10:30 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:49 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC