Browse Source

added edge cases for one or both numbers = 0

remotes/origin/ggT
cxnnqr 11 months ago
parent
commit
d76b8867fe
  1. 8
      src/ggT/ggT.c

8
src/ggT/ggT.c

@ -2,6 +2,14 @@
int ggT(int a, int b){
if(a == 0 && b == 0){
return 0;
} else if(a == 0){
return b;
} else if(b == 0){
return a;
}
while (b != 0) {
int temp = b;
b = a % b;

Loading…
Cancel
Save