fork download
  1. using static System.Console;
  2. using static System.Math;
  3.  
  4. public class Program {
  5. public static void Main() => WriteLine(CalculatesInterest(100M, 5, 0.01M));
  6. public static decimal CalculatesInterest(decimal valorInicial, int meses, decimal juros) => decimal.Round(valorInicial * (decimal)Pow(1.0 + (double)juros, meses), 2);
  7. }
  8.  
  9. //https://pt.stackoverflow.com/q/443699/101
Success #stdin #stdout 0.03s 16504KB
stdin
Standard input is empty
stdout
105.10