Your program has undefined behaviour. It fails to return values from fun1. Anything could happen.
The fact that it compiles at all implies that your compiler adheres to an older standard.
For instance C89 says:
If a return statement without an expression is executed, and the value of the function call is used by the caller, the behavior is undefined. Reaching the } that terminates a function is equivalent to executing a return statement without an expression.
On the other hand C99 says:
A return statement without an expression shall only appear in a function whose return type is void.
So, if your compiler adheres strictly to C99 or later then your code is invalid.
It's a little pointless reasoning about why the program behaves as it does, since its behaviour is undefined. Perhaps the ABI for this compiler happens to expect the return value to be placed in a register which also contains the value of the caller's loop variable i when fun1 was called. In any case, your program could output anything at all.
Since fun1 has a return type that it not void, you should use the form of the return statement that has an expression. For instance:
int fun1(int i)
{
return i;
}