source: Deliverables/D4.1/GCC/EuclideanAlgorithm.c @ 557

Last change on this file since 557 was 186, checked in by mulligan, 9 years ago

Added C code to write to SBUF SFR for Roberto.

File size: 216 bytes
Line 
1int gcd(int a, int b)
2{
3  if(b > a)
4    return gcd(b, a);
5  else if(b == 0)
6    return a;
7  else
8    return gcd(b, a % b);
9}
10
11int main()
12{
13  int a;
14  a = gcd(5, 15);
15  if(a == 5)
16    return 5;
17  else
18    return 7;
19}
Note: See TracBrowser for help on using the repository browser.