ifElse
This commit is contained in:
parent
99e528e51e
commit
ddc33e2beb
4 changed files with 72 additions and 6 deletions
|
@ -8,11 +8,11 @@
|
|||
}
|
||||
|
||||
public static decimal sum()
|
||||
{
|
||||
int a = 3;
|
||||
decimal b = 5;
|
||||
decimal sum = a + b;
|
||||
return sum;
|
||||
{
|
||||
int a = 3;
|
||||
decimal b = 5;
|
||||
decimal sum = a + b;
|
||||
return sum;
|
||||
|
||||
}
|
||||
private static decimal Sum(decimal a, decimal b)
|
||||
|
@ -20,10 +20,16 @@
|
|||
return a + b;
|
||||
}
|
||||
|
||||
private static void ReturnNothing()
|
||||
{
|
||||
Console.WriteLine("Denne metoden returnerer ingenting");
|
||||
}
|
||||
|
||||
public static void Run()
|
||||
{
|
||||
Console.WriteLine(sum());
|
||||
Console.WriteLine(Sum(9,5));
|
||||
Console.WriteLine($"Summen av 9 og 5 er: {Sum(9,5)}");
|
||||
ReturnNothing();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue