Driver code
int main ( ) { int a [ ] = { 1 , 4 , 7 , 2 , 3 } ; int b [ ] = { 2 , 11 , 7 , 4 , 15 , 20 , 24 } ; int n = sizeof ( a ) / sizeof ( a [ 0 ] ) ; int m = sizeof ( b ) / sizeof ( b [ 0 ] ) ; cout << count_common ( a , n , b , m ) ; return 0 ; }