- Methods 6:24
- Defining methods 4:14
- Methods 7 questions
- Variable Scope 3:17
- Defining a Method 1 objective
- Method Arguments 4:30
- Method Return Values 6:30
- The Difference Between Printing and Returning 1:42
- Variable Scope and Method Arguments 5 questions
- Returning a Value from the Ask Method 3:30
- Method Parameters 1 objective
- Return Values 5 questions
- Return Values 1 objective
Quiz Question 1 of 5
Will the below code compile, run, and produce the output "2"? If not, why not?
using System;
class Program
{
static int Subtract(int a, int b) {
return a - b;
}
static void Main(string[] args)
{
Console.WriteLine(Subtract(7, 5));
}
}
Choose the correct answer below: