lines 9 and 19: why did you stick those returns in the middle of those if statements? That makes line 10, 11, 20 and 21 unusable because they can never be executed.
Mising } between lines 12 and 13.
Here's the full code. I just didn't want to show it all since I know the main is really incomplete right now.
void gcd(int x, int y)
if (x > y)
c = x % y;
x = y;
y = c;
if (y > x)
d = x % y;
y = x;
x = d;
int main (void)
printf("Please enter a value for x:\n");
scanf("%d" , &x);
printf("Please enter a value for y:\n");
scanf("%d" , &y);
printf("gcd of x and y %d and %d\n", x, y);
I added the brace in between those 2 lines you said.
I didn't know those lines would become unusable. I fixed it.
I forgot to add the errors.
gcd.c: In function 'gcd':
gcd.c:13: warning: 'return' with a value, in function returning void
gcd.c:24: warning: 'return' with a value, in function returning void
gcd.c: In function 'main':
gcd.c:35: error: 'x' undeclared (first use in this function)
gcd.c:35: error: (Each undeclared identifier is reported only once
gcd.c:35: error: for each function it appears in.)
gcd.c:40: error: 'y' undeclared (first use in this function)