Only operating system can call main
when it runs the program. Other than operating system no one can call any function named main
. So if want to calculate factorial using recursion then you have to write another function to calculate that recursively and call that function from main
.
You can ask why is this? Answer is this is the syntax.