In my class in college, my teacher did not really explain well how this code would output . I did not come across this kind of example when I searched the site, and I would like to share it with you. I have got one more question,is this function working like a recursive function too?
#include <stdio.h>
void F(int *a, int b)
{
(*a)--;b+=2;
if(*a+b<10)
{
printf("\n%d %d",*a,b);
return;
}
(*a)--;b--;
printf("\n%d %d",*a,b);
F(&b,*a);
(*a)++;b++;
printf("\n%d %d",*a,b);
return;
}
main()
{
int b=5;
F(&b,b);
printf("\n%d",b);
return 0;
}