Gowtham,
How many times do we have to say "If you want help with your code, you must attach your code, not a picture of it, but the VI itself". The code will (almost) always work the way you tell it to work -- if it doesn't work the way you want it to work, then you are doing something "wrong" (or maybe you just aren't thinking the problem through correctly), but in any case, we can't comment on code we can't see!!!
Bob Schor