Minimum positive integer value possible of X for given A and B in X = P * A + Q * B | CSHARP Program to find minimum value of X in equation X = P * A + Q * B ; function to get gcd of a and b ; Driver Code
using System ; class GFG { public static int gcd ( int a , int b ) { if ( a == 0 ) return b ; return gcd ( b % a , a ) ; } static public void Main ( ) { int a = 2 ; int b = 4 ; Console . WriteLine ( gcd ( a , b ) ) ; } }