Maha

Maha

  • NA
  • 0
  • 326.3k

Reason for different o/p

Sep 8 2013 11:44 AM
Following program reverses the i/p.

When you remove following code
Console.Write("Reverse number: ");
Console.Write(arrayChar);

and inserted following one

Console.Write("Reverse number: " + arrayChar);
o/p for whatever i/p is
Reverse number: System.Char[]

Please explain the reason for different o/p. Problem is highlighted.

using System;

class Program
{
static void Main()
{
Console.Write("Enter any number: ");

string s = Console.ReadLine();

char[] arrayChar = s.ToCharArray();
Array.Reverse(arrayChar);

Console.Write("Reverse number: ");
Console.Write(arrayChar);

Console.ReadLine();
}
}


Answers (2)