Last active
August 29, 2015 14:24
-
-
Save Fhernd/76f0a8f0cf4298fc5de9 to your computer and use it in GitHub Desktop.
Prueba de Enlace de Lenguaje en C#.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OrtizOL - xCSw | |
using System; | |
public class SinInterfazComun | |
{ | |
public static void Main() | |
{ | |
Int32 num1 = 3; | |
Int32 num2 = 7; | |
Console.WriteLine("Promedio de {0} y {1}: {2}", num1.ToString(), | |
num2.ToString(), | |
Promedio(num1, num2)); | |
} | |
// Versión dinámica de cálculo de promedio de dos números: | |
public static dynamic Promedio(dynamic x, dynamic y) | |
{ | |
return (x + y) / 2; | |
} | |
// public static Int32 Promedio(Int32 x, Int32 y) | |
// { | |
// return (x + y) / 2; | |
// } | |
// public static double Promedio(double x, double y) | |
// { | |
// return (x + y) / 2; | |
// } | |
// Otras implementaciones para los tipos integrales (o integrales) | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment