Examveda

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

A. 0

B. 3

C. 3.0

D. 3.1

Answer: Option B


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

Join The Discussion

Related Questions on Miscellaneous in C Sharp