fork download
  1. using static System.Console;
  2. using static System.Math;
  3.  
  4. public class Test {
  5. public static void Main() {
  6. WriteLine($"O valor de PI é: {Round(Calculadora.PI, 4)}");
  7. WriteLine($"A área é: {Calculadora.CalculaAreaCircunferencia(2):0.####}");
  8. }
  9. }
  10.  
  11. public class Calculadora {
  12. public static double PI = System.Math.PI;
  13. public static double CalculaAreaCircunferencia(double raio) => PI * Pow(raio, 2);
  14. }
  15.  
  16. //https://pt.stackoverflow.com/q/571427/101
Success #stdin #stdout 0.03s 25104KB
stdin
Standard input is empty
stdout
O valor de PI é: 3.1416
A área é: 12.5664