>and there is also another bug in here
You have a little problem matching your else with the rest of the conditional statements. Here:
Code:
y=n;
}
printf("your number arge:%d%d",x,y);
else
The printf call ends the first series of tests, so the else after that is illegal. This may not be what you wanted, your intentions are a bit confusing in this program:
Code:
#include <stdio.h>
int main (void)
{
int x;
int y;
int n;
printf("enter your two numbers: ");
scanf("%d %d",&x,&y);
if(y==0)
printf("your number is:%d\n",x);
else if (x<y) {
n=x;
x=y;
y=n;
}
else {
n=x;
x=y;
y=n%y;
}
printf("your numbers are %d %d\n",x,y);
return 0;
}
>I need to be able to make this function recursive
You don't want to call main recursively, is there another function you were talking about? Because as it is this program really wouldn't benefit from recursion.
-Prelude