•
•
•
•
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:
Rep Power: 1
Solved Threads: 0
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.
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.
•
•
•
•
•
•
•
•
DaniWeb VB.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Why I can't see the result (Visual Basic 4 / 5 / 6)
- Working With Dataset (VB.NET)
- vb6 to vb.net conversion problems (VB.NET)
- assigning arrays in VB (Visual Basic 4 / 5 / 6)
Other Threads in the VB.NET Forum
- Previous Thread: Need Help
- Next Thread: RE: Changing the size of a file.



Threaded Mode