|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
You want to find the number of "0" occurence in 1-100? Can you please clarify?
|
|
#3
|
|||
|
|||
|
no i meant the number of zeros for 100 exponential
100! |
|
#4
|
||||
|
||||
|
I still don't get the assignment. How about documenting your code so we can see your logic on how this is supposed to work?
100! = 1x2x3x4...x100 (= a very very large number) I don't understand "number of zeros" in this context at all sorry.
__________________
medialint.com "Energy has the opportunity to change the climate if it's done right." - Sen. John Ensign, R-Nev. (quoted out of context) |
|
#5
|
||||
|
||||
|
Maybe the occurrence of 0 per number generated by exp(x).
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Help with finding zeros for 100! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|