C # program to maximise the sum of two Numbers using at most one swap between them
using System ; class GFG { static int MAX = 100 ; static int max_element ( int [ ] arr , int pos ) { int tmp = arr [ 0 ] ; int ind = 0 ; for ( int i = 1 ; i < pos ; i ++ ) { if ( tmp < arr [ i ] ) { tmp = arr [ i ] ; ind = i ; } } return ind ; }