Linear Diophantine Equations | utility function to find the GCD of two numbers ; This function checks if integral solutions are possible ; First example ; Second example ; Third example
< ? php function gcd ( $ a , $ b ) { return ( $ a % $ b == 0 ) ? abs ( $ b ) : gcd ( $ b , $ a % $ b ) ; } function isPossible ( $ a , $ b , $ c ) { return ( $ c % gcd ( $ a , $ b ) == 0 ) ; } $ a = 3 ; $ b = 6 ; $ c = 9 ; if ( isPossible ( $ a , $ b , $ c ) == true ) echo " Possible STRNEWLINE " ; else echo " Not ▁ Possible STRNEWLINE " ; $ a = 3 ; $ b = 6 ; $ c = 8 ; if ( isPossible ( $ a , $ b , $ c ) == true ) echo " Possible STRNEWLINE " ; else echo " Not ▁ Possible STRNEWLINE " ; $ a = 2 ; $ b = 5 ; $ c = 1 ; if ( isPossible ( $ a , $ b , $ c ) == true ) echo " Possible STRNEWLINE " ; else echo " Not ▁ Possible STRNEWLINE " ; ? >