Not quite correct.
When you use:
long f;
Int a;
....etc...
f = fact(a );
The compiler must already seen the code for the function. Otherwise the compiler can't know if you are using the function correctly.
Therefore, you put the function code in your file outside of main(). Unfortunately, if you need this function in another implementation file you must make a copy of the function code and paste it in the second file outside of any function and before the first call.
Everything works but you now have two copies of the function code. Duplicate code is a big no-no.
You avoid the duplicate by erasing all of the function code except the first line:
long fact(int);
This is the function prototype. It tells the compiler that there is fact function with an int argument
that returns an int but the function code is somewhere else. Now instead generating an error, the compiler generates an "unresolved external reference". This hands the responsibilty of finding the function code and linking it to the function calls to the linker.