Understanding The Use of Return
I am struggling to grasp a firm grip on How and when it is necessary to use return when creating your own functions in C..
I saw this piece code Yesterday:
Code:
#include <stdio.h>
unsigned int Fac(unsigned int n)
{
if((n <= 1))
return 1;
return n * Fac(n-1);
}
int main()
{
printf("%d\n", Fac(10));
return 0;
}
I do understand that the return type comes first and the argument type comes next in the parentheses, but the way this person used
return in this function is kind of hard for me to grasp.
I would like know where I can read all about how to use returns in created functions and the main function, as well as its purpose in c programming..
Thank You in advance...