ive written a program to generate 100 random integer numbers in the range of 1 to 6. For each value i need to count its occurence and store in an element of an array, and i don't know how do to this. Can n e one help.
ive written a program to generate 100 random integer numbers in the range of 1 to 6. For each value i need to count its occurence and store in an element of an array, and i don't know how do to this. Can n e one help.

This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.
This is a possible solution for VB/VBA. I don't know .Net (there is a separate forum for .Net):
' Array with random numbers
Dim arintRandomNumbers(1 To 100) As Integer
' Array with counts
Dim arintCount(1 To 6) As Integer
' Loop counter
Dim i As Integer
' Fill array with random numbers
For i = 1 To 100
arintRandomNumbers(i) = Int(Rnd * 6 + 1)
Next i
' Make sure arintCount is initialized to zeros
Erase arintCount
' Compute counts
For i = 1 To 100
arintCount(arintRandomNumbers(i)) = arintCount(arintRandomNumbers(i)) + 1
Next i
' Display counts
For i = 1 To 6
Debug.Print arintCount(i)
Next i