Originally Posted by
Salem
> I used the following for mode part(by following the technique of 1-D array) which didn't work,,
Presumably because the largest value in your array is 10.
Given your freq[10], this would be an array overrun.
The idea is sound, so long as your freq array is large enough.