Functions and Subroutines - Programming

Q1:

What will be the output of the C#.NET code snippet given below?
namespace AptitudeCrackConsoleApplication
{
    class SampleProgram
    {
        static void Main(string[ ] args)
        {
            int i;
            int res = fun(out i);
            Console.WriteLine(res);
        }
        static int fun (out int i)
        {
            int s = 1;
            i = 7;
            for(int j = 1; j <= i; j++)
            {
                s = s * j;
            }
            return s;
        } 
    } 
}

A 1

B 7

C 8

D 720

E 5040

ANS:E - 5040

No answer description is available. Let's discuss.