Infosys Interview Question

write a program to find longest common prefix