Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27474

Squared Sum

$
0
0
Write a program that displays the sum of the squares given the range of integers by the user.

This is what I got. The problem is that it won't display anything.

Private Sub btnAnswer_Click(sender As Object, e As EventArgs) Handles btnAnswer.Click
Dim Sum As Object
Dim Last As String
Dim Num As Object
Dim First As String

First = CInt(txtFirst.Text)
Last = CInt(txtLast.Text)
Sum = 0

Do
Sum = Sum + Num * Num
Num = Num + 1
Loop Until Num > Last
End Sub
End Class

Viewing all articles
Browse latest Browse all 27474

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>