1#include <stdio.h>
2int hcf(int n1, int n2);
3int main() {
4 int n1, n2;
5 printf("Enter two positive integers: ");
6 scanf("%d %d", &n1, &n2);
7 printf("G.C.D of %d and %d is %d.", n1, n2, hcf(n1, n2));
8 return 0;
9}
10
11int hcf(int n1, int n2) {
12 if (n2 != 0)
13 return hcf(n2, n1 % n2);
14 else
15 return n1;
16}
17