Find larger of x ^ y and y ^ x | Javascript program to print greater of x ^ y and y ^ x ; Driver Code
function printGreater ( x , y ) { let X = y * Math . log ( x ) ; let Y = x * Math . log ( y ) ; if ( Math . abs ( X - Y ) < 1e-9 ) { document . write ( " " ) ; } else if ( X > Y ) { document . write ( x + " " + y ) ; } else { document . write ( y + " " + x ) ; } } let x = 5 , y = 8 ; printGreater ( x , y ) ;