//C# Optionele Argumenten - Optional Procedures en Functies public class Example1 { void Main() { Console.WriteLine(this.GetPower(3, 3)); Console.WriteLine(this.GetPower(3)); Console.ReadLine(); } void GetPower(int @base, int exponent) { GetPower = (@base + exponent); } } public class Example2 { void Main() { this.ShowSum(1); this.ShowSum(2, 3); this.ShowSum(4, 0, 5); this.ShowSum(6, 7, 8); this.ShowSum(1); this.ShowSum(2, 3); this.ShowSum(4, 5); this.ShowSum(6, 7, 8); this.ShowSum(5, 4); this.ShowSum(8, 7, 6); this.ShowSum(4, 5); Console.ReadLine(); } void ShowSum(int value1, int value2, int value3) { Console.WriteLine(((value1 + value2) + value3)); } } //Bezoek www.vbvoorbeelden.be voor meer C# voorbeelden. //Copyright - De Wolf / vbvoorbeelden - 2003-2011 - Alle rechten voorbehouden.