View Single Post
Old 05-01-2008, 01:00 AM   #1 (permalink)
ludask
Recruit
 
Join Date: May 2008
Posts: 3
ludask is on a distinguished road
help with finding zeros for 100!

hi all
using VB2005
im trying to write a code to find number of zeros of 100! but cant get it to work properly?
help would be good
heres the code ive done so far

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer = 0
Dim num As Integer = 0
Dim start As Integer = 0
Dim theend As Integer = 100


While (start <= 100)

num = start
While (start Mod 5 = 0)
start = start / 5
i += 1

End While
start = num

While (start Mod 2 = 0)

start = start / 2
start += 1

End While

End While

Label1.Text = i





End Sub
End Class
ludask is offline   Reply With Quote