Driver code
int main ( ) { int set1 [ ] = { 1 , 3 , 9 , 27 , 81 , 243 } ; int n1 = sizeof ( set1 ) / sizeof ( set1 [ 0 ] ) ; cout << lenOfLongestGP ( set1 , n1 ) << " STRNEWLINE " ; int set2 [ ] = { 1 , 3 , 4 , 9 , 7 , 27 } ; int n2 = sizeof ( set2 ) / sizeof ( set2 [ 0 ] ) ; cout << lenOfLongestGP ( set2 , n2 ) << " STRNEWLINE " ; int set3 [ ] = { 2 , 3 , 5 , 7 , 11 , 13 } ; int n3 = sizeof ( set3 ) / sizeof ( set3 [ 0 ] ) ; cout << lenOfLongestGP ( set3 , n3 ) << " STRNEWLINE " ; return 0 ; }