Histogram problem code

i made the code


but it gives runtime errror

https://ideone.com/d8zGzJ *updated

i updated it to a bit https://ideone.com/d8zGzJ

Tushar plz refer to this code, i have made some changes, that were required in your current code, if you doesnt understand the logic, and changes i made, kindly refer to the online video available in your course on this current problem.
This is the corrected code :