I have made the code so that it takes in an input, a string, and then;
- Outputs the string, no changes made
- Shows the string but from the array, so that it would be listed
- It would then output the list after it has been reversed.
So far with my code i have done this:
string input;
int arLENGTH;
Console.WriteLine("Enter the string you want to be reversed.");
input = Console.ReadLine();
char[] chars = input.ToCharArray();
Console.WriteLine("Original string: " + input);
Console.WriteLine("Character array(Not Reversed):");
for (int a = 0; a < chars.Length; a++)
{
Console.WriteLine(chars[a]);
}
arLENGTH = chars.Length;
Console.WriteLine("Reversed String: ");
while (arLENGTH > chars.Length)
{
Console.WriteLine(chars[arLENGTH]);
arLENGTH--;
}
Console.ReadLine();
When i run it, it outputs Reversed String, and then just leaves it blank.