Originally Posted by shabbir
Its always good to help somebody with the program logic but its not good to put the complete program as a whole so that he does not need to anything but just copy and paste.
I agree but the problem is so small that just giving the hints resulted in the complete program.