Examveda

What will be the output of the following C# code?
static void main(string[] args)
{
    int i;
    int res = fun (out i);
    console.writeline(res);
    console.readline();
}
static int fun(out int i)
{
    int s = 1;
    i = 7;
    for (int j = 1; j <= i; j++ )
    s = s * j;
    return s;
}

A. 4490

B. 5040

C. 5400

D. 3500

Answer: Option B


Join The Discussion

Related Questions on Arrays and Strings in C Sharp