Complete the code to make the method return an integer value.
public int GetNumber() {
return [1];
}The method returns an integer, so returning 5 is correct.
Complete the code to call the method and store its return value.
int result = [1]();The method GetNumber returns an int, so calling it and storing the result is correct.
Fix the error in the method so it compiles correctly.
public void PrintMessage() {
[1] "Hello!";
}The method should print the message using Console.WriteLine. Using return here is incorrect because the method is void.
Complete the code to create a method that returns the sum of two integers.
public int Sum(int a, int b) {
return a [1] b;;
}The method returns the sum of a and b. The operator is + and the statement ends with a semicolon ;.
Fill both blanks to create a method that returns the uppercase version of a string.
public string ToUpperCase(string input) {
string result = input[1]();
return [2];
// End of method
}ToUpper.The method calls ToUpper() on the input string, stores it in result, then returns result. The last blank is empty because no extra code is needed after the return.