fork download
  1. using System;
  2.  
  3. public class Calculadora
  4. {
  5. public double Suma (int a, int b)
  6. {
  7. return a + b;
  8. }
  9.  
  10. public double Suma (double a, double b)
  11. {
  12. return a + b;
  13. }
  14.  
  15. public static void Main()
  16. {
  17. Calculadora calc = new Calculadora();
  18.  
  19. Console.WriteLine ("Suma de enteros: 3 + 5 = {0}", calc.Suma(3, 5));
  20. Console.WriteLine ("Suma de decimales (double): 3.5 + 5.3 = {0}", calc.Suma(3.5, 5.3));
  21. }
  22. }
Success #stdin #stdout 0.03s 33904KB
stdin
Standard input is empty
stdout
Suma de enteros: 3 + 5 = 8
Suma de decimales (double): 3.5 + 5.3 = 8.8