Maximum GCD of two numbers possible by adding same value to them | Java implementation of above approach . ; Function to calculate maximum gcd of two numbers possible by adding same value to both a and b ; Driver Code ; Given Input
import java . io . * ; class GFG { static void maxGcd ( int a , int b ) { System . out . println ( Math . abs ( a - b ) ) ; } public static void main ( String [ ] args ) { int a = 2231 ; int b = 343 ; maxGcd ( a , b ) ; } }