11. What is the purpose of the out keyword in C# method parameters? A. To specify that a parameter is optional B. To pass a parameter by reference C. To specify that a parameter is an output parameter D. To specify that a parameter is constant Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
12. In C#, which keyword is used to exit from a method without returning any value? A. break B. return C. exit D. continue Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
13. What is the correct way to define a method named PrintMessage that does not take any parameters and does not return any value in C#? A. PrintMessage(void) B. void PrintMessage(void) C. PrintMessage() D. void PrintMessage() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
14. What is the purpose of method parameters in C#? A. To specify the return type of the method B. To specify the name of the method C. To pass data to the method D. To specify the access modifier of the method Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
15. What is the correct way to define a method named GetSquare that takes an integer parameter num and returns its square in C#? A. GetSquare(num) B. int GetSquare = (int num) { return num * num; } C. int GetSquare(int num) D. int GetSquare(num) { return num * num; } Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
16. What is the purpose of the static keyword when applied to a method in C#? A. To make the method constant B. To make the method accessible without creating an instance C. To make the method abstract D. None of the above Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
17. What is the correct way to define a method named CalculateSum that takes two integers as parameters and returns their sum in C#? A. void CalculateSum(int num1, int num2) { return num1 + num2; } B. CalculateSum = (int num1, int num2) => num1 + num2; C. int CalculateSum(int num1, int num2) D. int CalculateSum(num1, num2) Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
18. In C#, which access modifier is used to restrict access to a method within the same class or derived classes? A. protected B. internal C. private D. public Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
19. What is the return type of a method that does not return any value in C#? A. null B. None C. Unit D. void Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
20. In C#, which keyword is used to define a method that belongs to a class and can be called without creating an instance of the class? A. static B. dynamic C. instance D. method Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board