Commit bf4361e6 authored by Christian Würdig's avatar Christian Würdig
Browse files

added missing variable

parent d622a223
......@@ -19,14 +19,20 @@ int gcd(int a, int b)
int main(int argc, char** argv)
{
int a = 49, b = 35;
int a = 49, b = 35, i, g;
if(argc > 2) {
a = atoi(argv[1]);
b = atoi(argv[2]);
}
printf("gcd.c\n");
printf(" GCD of %d and %d is %d\n", a, b, gcd(a,b));
for (i = 0; i < 100000; i++) {
g = gcd(a, b);
}
printf(" GCD of %d and %d is %d\n", a, b, g);
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment