TOPIC

Runtime error for c#

Mehedi Hasan asked 6 months ago

I have done the problem with c#. I've added my code down here. Can anyone please help me out ?

        var A = Convert.ToDouble(Console.ReadLine());
        var B = Convert.ToDouble(Console.ReadLine());
        var C = Convert.ToDouble(Console.ReadLine());

        const double pi = 3.14159;

        Console.WriteLine($"TRIANGULO: {((1.0/2)*A*C).ToString("0.000")}");
        Console.WriteLine($"CIRCULO: {(pi * C * C).ToString("0.000")}");
        Console.WriteLine($"TRAPEZIO: {(((A+B)/2) * C).ToString("0.000")}");
        Console.WriteLine($"QUADRADO: {(B * B).ToString("0.000")}");
        Console.WriteLine($"RETANGULO: {(A * B).ToString("0.000")}");

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.