diff --git a/ClassDemo1/Program.cs b/ClassDemo1/Program.cs index c2eb53b..c259a22 100644 --- a/ClassDemo1/Program.cs +++ b/ClassDemo1/Program.cs @@ -20,10 +20,32 @@ namespace ClassDemo1 int sum = SumMyBitchUp(420, 69); Write($"Sum: {sum}"); + int nyVerdi = SumMyBitchUp(sum, 45678); + Write($"Ny verdi: {nyVerdi}"); + + int allMyBitches = SumAllMyBitchesUp(tall); + int allMyBitchesV2 = SumAllMyBitchesUpV2(tall); + Write($"DÆTTA ER ALLI SOMMA LAGT SAMMEN, TO FORSKJELLIGE GANGER: {allMyBitches} & {allMyBitchesV2}"); Console.ReadLine(); } + static int SumAllMyBitchesUp(int[] bitches) + { + return bitches.Sum(); + } + + static int SumAllMyBitchesUpV2(int[] bitches) + { + int sum = 0; + foreach (var tall in bitches) + { + sum = SumMyBitchUp(sum, tall); + } + + return sum; + } + static int SumMyBitchUp(int first, int second) { return first + second;