Program to compare two fractions | Get max of the two fractions ; Declare nume1 and nume2 for get the value of first numerator and second numerator ; Compute ad - bc ; Driver Code
function maxFraction ( first , sec ) { a = first [ 0 ] ; b = first [ 1 ] c = sec [ 0 ] ; d = sec [ 1 ] Y = a * d - b * c return ( Y > 0 ) ? first : sec ; } first = [ 3 , 2 ] ; sec = [ 3 , 4 ] ; res = maxFraction ( first , sec ) ; document . write ( res [ 0 ] + " " + res [ 1 ] ) ;