12 #include <stdio.h> int gcd(int a, int b) { if (b == 0) { return a; // Base case } else { return gcd(b, a % b); } } int main() { int num1, num2; printf("Enter two integers: "); scanf("%d %d", &num1, &num2); int result = gcd(num1, num2); printf("The GCD of %d and %d is %d\n", num1, num2, result); return 0; } GCD program with tracing: Step 1:gcd(48, 18) i.e. a=48, b=18 if(18==0) False (b, a % b)=> (18, 48 % 18 =12) Step 2: gcd(18, 12) i.e. a=18, b=12 if(12==0) False (b, a % b)=>(12, 18 % 12 =6) Step 3: gcd(12, 6) i.e. a=12, b=6 if(6==0) False (b, a % b)=> (6,12 % 6 =0) Step 4: gcd(6, 0) i.e. a=6, b=0 if(0==0) True (return a) (b, a % b)=>(0, 6 % 0 = 6) // Step 5: gcd(0, 6) => return 6 (since b == 0)