Driver code
int main ( ) { int ar1 [ ] = { 1 , 5 , 10 , 20 , 40 , 80 , 80 } ; int ar2 [ ] = { 6 , 7 , 20 , 80 , 80 , 100 } ; int ar3 [ ] = { 3 , 4 , 15 , 20 , 30 , 70 , 80 , 80 , 120 } ; int n1 = sizeof ( ar1 ) / sizeof ( ar1 [ 0 ] ) ; int n2 = sizeof ( ar2 ) / sizeof ( ar2 [ 0 ] ) ; int n3 = sizeof ( ar3 ) / sizeof ( ar3 [ 0 ] ) ; cout << " Common ▁ Elements ▁ are ▁ " ; findCommon ( ar1 , ar2 , ar3 , n1 , n2 , n3 ) ; return 0 ; }