Someone please let me know where is the error in my code and also help me in showing histogram