Examveda

What will be the output of the following C# code?
static void Main(string[] args)
{
    int n = 5;
    int x = 4;
    int z, c, k;
    for (c = 1; c <= n; c++)
    {
        for (k = 1; k <= c; k++)
    {
        z = 3 * x * x + 2 * x + 4 / x + 8;
        Console.Write(Convert.ToString(Convert.ToChar(z)));
    }
        Console.WriteLine("\n");
    }
    Console.ReadLine();
}

A. A
AA
AAA
AAAA

B. A
AB
ABC
ABCD

C. A
AA
AAA
AAAA
AAAAA

D. A
BC
DEF
DEFG

Answer: Option C


Join The Discussion

Related Questions on Operators and Expressions in C Sharp