C ++ program to find longest common prefix of given array of words .
#include <iostream> NEW_LINE #include <algorithm> NEW_LINE using namespace std ; string longestCommonPrefix ( string ar [ ] , int n ) {