adplus-dvertising
frame-decoration

Question

What will be the output of the given code snippet?
static void Main(string[] args)
  {
      string[] strings = {"beta", "alpha", "gamma"};
      Console.WriteLine("Array elements: ");
      DisplayArray(strings);
      Array.Reverse(strings); 
      Console.WriteLine("Array elements now: ");
      DisplayArray(strings);
      Console.ReadLine();
   }
   public static void DisplayArray(Array array)
   {
       foreach (object o in array)
       {
           Console.Write("{0} ", o);
       }
           Console.WriteLine();
   }

a.

Array elements:
beta alpha gamma
Array elements now:
ammag ahpla ateb

b.

Array elements:
beta alpha gamma
Array elements now:
gamma beta alpha

c.

Array elements:
beta alpha gamma
Array elements now:
gamma alpha beta

d.

None of the mentioned

Answer: (c).Array elements:
beta alpha gamma
Array elements now:
gamma alpha beta

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the given code snippet?

Similar Questions

Discover Related MCQs

Q. Which method will be used to copy content from one array to another array?

Q. Which mechanism among the following helps in identifying a type during the execution of a program?

Q. Select the statement which are correct about RTTI(Runtime type identification):

Q. Select the Keyword which supports the run time type identification:

Q. What does the following code signify?

expr is type

Q. Which operator among the following supports the operation of conversion at runtime without generating the exceptions?

Q. Which operator among the following is used to perform the operation of boxing, unboxing, reference and identity conversions?

Q. Which operator among the following supplies the information about characteristics of a typeof?

Q. Which feature enables to obtain information about the use and capabilities of types at runtime?

Q. Choose the namespace which consists of classes that are part of .NET Reflection API:

Q. Choose the correct statement about System.Type namespace:

Q. Choose the class from which the namespace ‘System.Type’ is derived:

Q. What does the following property signify?

MemberTypes MemberType

Q. The property signifies “Obtains a Module object that represents the module (an executable file) in which the reflected type resides”. Choose the property which specifies the following statement:

Q. Choose the method defined by MemberInfo:

Q. What does the following declaration specify?

MethodInfo[] GetMethods()

Q. What does the following code specify?

object Invoke(object obj, object[] parameters)

Q. What does the following method specify?

Type[] GetGenericArguments()

Q. Select the type of multitasking methods that exist:

Q. Choose the correct statement about process-based multitasking: