projects
/
libfirm
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
moved typedefs to bearch_t.h
[libfirm]
/
ir
/
be
/
test
/
gcd.c
1
#include <stdio.h>
2
3
int gcd(int a, int b)
4
{
5
int i = 0;
6
7
while(a != b)
8
{
9
if(a > b) {
10
a = a - b;
11
}
12
else {
13
b = b - a;
14
}
15
++i;
16
}
17
return a;
18
}
19
20
int main(void)
21
{
22
int a = 49, b = 35;
23
24
printf("gcd.c\n");
25
printf(" GCD of %d and %d is %d\n", a, b, gcd(a,b));
26
27
return 0;
28
}