Reduce the fraction to its lowest form | Function to reduce a fraction to its lowest form ; Driver Code
function reduceFraction ( x , y ) { let d ; d = __gcd ( x , y ) ; x = parseInt ( x / d ) ; y = parseInt ( y / d ) ; document . write ( " " + x + " " + y ) ; } function __gcd ( a , b ) { if ( b == 0 ) return a ; return __gcd ( b , a % b ) ; } let x = 16 ; let y = 10 ; reduceFraction ( x , y ) ;