Choose two elements from the given array such that their sum is not present in any of the arrays | C # implementation of the approach ; find maximum element in an array ; 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
using System ; class GFG { static int max_element ( int [ ] a , int n ) { int m = int . MinValue ; for ( int i = 0 ; i < n ; i ++ ) m = Math . Max ( m , a [ i ] ) ; return m ; } static void findNum ( int [ ] a , int n , int [ ] b , int m ) { int x = max_element ( a , n ) ; int y = max_element ( b , m ) ; Console . Write ( x + " ▁ " + y ) ; } public static void Main ( ) { int [ ] a = { 3 , 2 , 2 } ; int n = a . Length ; int [ ] b = { 1 , 5 , 7 , 7 , 9 } ; int m = b . Length ; findNum ( a , n , b , m ) ; } }