Can smbd help me to convert some values from real to virtual?

How to add 1 to 1000 values in Visual Basic 2010..need help please!!?

  • I need to have 1000 values and then have them added at the end but i dont know the exact code for it. Im new to this program and im learning about them. I know i need to use some sort of a loop but i don't know which one exactly..can anyone help me please! I have the following code (this is just an example): Dim values () As Integer = {85, 77,....} Dim result As Integer For i = ø to values.Getupperboud(ø) result += values(i) Next lblresult.text = convert.tostring(result) but i have to use the same code only that it needs to have 1000 and have to display the final addition once i debug it...thanx again

  • Answer:

    Try this code. It generates 1000 random numbers between 1 and 25, adds them together, places each number in a listbox, and finally shows the total of all 1000 numbers. It uses a button and a listbox. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim Total, Num As Double For i = 1 To 1000 Randomize() 'Dim Rnd As New Random Num = Fix(Rnd() * 25 + 1) Total += Num ListBox2.Items.Add(Num) Next ListBox2.Items.Add(" ") ListBox2.Items.Add(" ") ListBox2.Items.Add(" ") ListBox2.Items.Add(Total) End Sub TexMav

Anonymou... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.