Program to find greater value between a ^ n and b ^ n | Function to find the greater value ; If n is even ; Driver code
function findGreater ( a , b , n ) { if ( ! ( ( n & 1 ) > 0 ) ) { a = Math . abs ( a ) ; b = Math . abs ( b ) ; } if ( a == b ) document . write ( " " + " " ) ; else if ( a > b ) document . write ( " " + " " ) ; else document . write ( " " + " " ) ; } var a = 12 , b = 24 , n = 5 ; findGreater ( a , b , n ) ;