This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Welcome to CodeRanch mayank. this is not regarding the solution to your question, but a suggestion that start using code blocks for putting your code, this will keep the patience or readers alive to read your code & answer them.