Hello. I've been trying to understand why the output of the following program is:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles Button1.Click
Dim i, j, number As Integer
number = 0
For i = 1 To 5
For j = 1 To i
number += 1
TextBox1.Text = TextBox1.Text & number & Chr(13) & Chr(10)
Next
Next
End Sub
End Class
The part I did not understand is why the output continues after 5.. It supposed to end the For..Next when i=5 .. Also I have made the parts I didn't understand Bold. It's probably really simple question sorry for being so noob :)
Quote:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Quote:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles Button1.Click
Dim i, j, number As Integer
number = 0
For i = 1 To 5
For j = 1 To i
number += 1
TextBox1.Text = TextBox1.Text & number & Chr(13) & Chr(10)
Next
Next
End Sub
End Class
The part I did not understand is why the output continues after 5.. It supposed to end the For..Next when i=5 .. Also I have made the parts I didn't understand Bold. It's probably really simple question sorry for being so noob :)