Program to find HCF ( Highest Common Factor ) of 2 Numbers | Recursive function to return gcd of a and b ; Driver code
function gcd ( a , b ) { if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } var a = 98 , b = 56 ; document . write ( " " + a + " " + b + " " + gcd ( a , b ) ) ;