Public Class Form1
    Dim n, kq As Double
    Dim i As Integer
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        n = CDbl(TextBox1.Text)
        i = 0
        kq = 0
        Do
            i = i + 1
            kq = kq + i
        Loop Until (i > n - 1)
        TextBox2.Text = CStr(kq)
    End Sub
End Class
