User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 426,426 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,405 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser: Programming Forums
Views: 1271 | Replies: 3
Join Date: Mar 2008
Posts: 119
Reputation: sonia sardana is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
sonia sardana sonia sardana is offline Offline
Junior Poster

ParamArray Example

  #1  
May 8th, 2008
ParamArray means to allow a subrotine to take a variable no. of arguments.
I m just sending the arguments suppose i send 1,2,3,4,5
I want just the addition of these numbers.

Sub main()
Dim i As Integer
i = Console.ReadLine()
average(i)
Console.ReadLine()
End Sub

Sub average(ByVal ParamArray b() As Integer)
Dim total As Integer = 0
For i As Integer = LBound(b) To UBound(b)
total = total + b(i)
Next

Console.WriteLine(total.ToString)
End Sub

I m not understanding what is wrong in the program,y the o/p is not coming which is intended.
plz go thru it & do reply back.
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb VB.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 2:21 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC