source:
Deliverables/D4.1/GCC/EuclideanAlgorithm.c
@
165
Last change on this file since 165 was 165, checked in by , 10 years ago | |
---|---|
File size: 219 bytes |
Line | |
---|---|
1 | #include "stdio.h" |
2 | |
3 | int gcd(int a, int b) |
4 | { |
5 | if(b > a) |
6 | return gcd(b, a); |
7 | else if(b == 0) |
8 | return a; |
9 | else |
10 | return gcd(b, a % b); |
11 | } |
12 | |
13 | int main() |
14 | { |
15 | int a; |
16 | a = gcd(5, 15); |
17 | printf("%d", a); |
18 | return 0; |
19 | } |
Note: See TracBrowser
for help on using the repository browser.