Thank you very much for ur kind help.
it is an interview question for me to explain in second interview.
Ur idea is very nice and i tested in my compiler it is working also
Thanks again