Choose two elements from the given array such that their sum is not present in any of the arrays | C ++ implementation of the approach ; Function to find the numbers from the given arrays such that their sum is not present in any of the given array ; Find the maximum element from both the arrays ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void findNum ( int a [ ] , int n , int b [ ] , int m ) { int x = * max_element ( a , a + n ) ; int y = * max_element ( b , b + m ) ; cout << x << " ▁ " << y ; } int main ( ) { int a [ ] = { 3 , 2 , 2 } ; int n = sizeof ( a ) / sizeof ( int ) ; int b [ ] = { 1 , 5 , 7 , 7 , 9 } ; int m = sizeof ( b ) / sizeof ( int ) ; findNum ( a , n , b , m ) ; return 0 ; }