ExamVeda
Login
Home
Classes and Objects in C Sharp
?

What will be the output of the following C# code?
class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine( vol(10));
        Console.WriteLine( vol(2.5f,  5));
        Console.WriteLine( vol( 5l,  4,  5));
        Console.ReadLine();
    }
    static int vol(int x)
    {
        return(x * x * x);
    }
    static float vol(float r,  int h)
    {
        return(3.14f * r * r * h);
    }
    static long vol(long l, int b, int h)
    {
        return(l * b * h);
    }
}

Answer & Solution
Correct Answer: Option D
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.