Last active
March 31, 2023 09:11
-
-
Save naazeri/f4dc321fbd08bc4ce2571abe1df435ce to your computer and use it in GitHub Desktop.
This file contains hidden or 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
void multiply(int number) | |
{ | |
number *= 2; | |
} | |
void add(ref int number) | |
{ | |
number += 1; | |
} | |
void subtract(out int number) | |
{ | |
number = 5; | |
number -= 1; | |
} | |
int age = 10; | |
multiply(age); | |
Console.WriteLine(age); | |
add(ref age); | |
Console.WriteLine(age); | |
subtract(out age); | |
Console.WriteLine(age); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment