Examveda

What will be the output of the following C# code snippet?
class Program
{
    static void Main(string[] args)
    {
        float x = 3.14F;
        int y = (int)Math.Abs(x);
        Console.WriteLine(y);
        Console.ReadLine();
    }
}

A. Compile time error

B. 3.14

C. 3

D. 4

Answer: Option C


This Question Belongs to C Sharp Programming >> Miscellaneous In C Sharp

Join The Discussion

Related Questions on Miscellaneous in C Sharp