summaryrefslogtreecommitdiff
path: root/algorithms/ggT.c
blob: 0b0b75e78acd082a216dcc050daa0298973e25cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>


unsigned int
ggT(unsigned int a, unsigned int b)
{
  if (b==0) {
    return a;
  } else {
    return ggT(b, a%b);
  }
}

int main(void)
{
  printf("%d\n", ggT(24, 4));

  return 0;
}