Can any one help me will this pseudo Code work out
Work what out? Pseudo code is a high level (and informal) code, that is used to describe an algorithm. It is *not* real code. It's for your consumption. Question? Does the pseudo code convey the algorithm that you want? If yes, then it works.
Henry