HTC Global Services Interview Question

simple programming qn