Home / MCQ Bank / Computer
Computer Functions And Methods In C Sharp

What is the correct syntax to declare a method named PrintMessage that prints a message to the console without returning any value in C#?

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option D • void PrintMessage() { Console.WriteLine("Message"); }

Related Computer Questions

Which event occurs when collapsible element is fully shown? What will be the output of the following C code? #include <stdio.h> void f(int a[][]) { a[0][1] = 3; int i = 0, j = 0; for (i = 0;i < 2; i++) for (j = 0;j < 3; j++) printf("%d", a[i][j]); } void main() { int a[2][3] = {0}; f(a); } If you want to secure a message, use a(n): Which of the following are generated from char pointer? How do you find the number of minutes between two DateTime objects in Ruby?