diff options
author | Patrick Simianer <p@simianer.de> | 2014-06-15 03:24:33 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-06-15 03:24:33 +0200 |
commit | cf3a29feb5887344b6633ead1b4b6d5657a15a4b (patch) | |
tree | f1149508f7305a48dba0226699dfafdd68d81969 /algorithms/ggT.c | |
parent | 5ddc763ab9953eebdaf78af4eb72288d7955b310 (diff) |
old stuff: algorithms
Diffstat (limited to 'algorithms/ggT.c')
-rw-r--r-- | algorithms/ggT.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/algorithms/ggT.c b/algorithms/ggT.c new file mode 100644 index 0000000..0b0b75e --- /dev/null +++ b/algorithms/ggT.c @@ -0,0 +1,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; +} + |