Saturday, 4 October 2014

Hi,

Please share your comments and suggestion to rectify the below code

This what is wanted to do

Dim counter , sum As Integer
For counter=1 to 100 step 10
sum+=counter
ListBox1.Items.Add (sum)
Next
* The program will calculate the sum of the numbers as follows:
sum=0+10+20+30+40+……


when I run it.it is giving something different.
Please let me know where I got wrong and why  I am getting different answer instead of 10 20 30....100


No comments:

Post a Comment