@SameerShah Since you have a problem in your code, Stack Overflow is the right place for the question. However, questions that just provide a large amount of code and ask the community members to debug it don't tend to do very well here. SO is not a debugging service. In addition to that, your question is very specific to your situation and is unlikely to help future visitors (since they won't be making the program the same way and would be unlikely to make the same output formatting mistake you did. This is why your first version of this question (and shortly this one) are closed as "too localized". – Anna Lear♦ 1 hour ago
It might be different if you could say what the expected output was to help narrow it down, but there's really nothing anyone can do but go through an extended debugging session with you. That's not really a good fit for Stack Overflow.