Hello every one:
I have to write a program that reverse and displays the charactors of a pharase typed from the keyboard.
This is what I wrote:
Please let me know what is wrong with the code I wrote.
Can you please re-write the code.
Thanks
I have to write a program that reverse and displays the charactors of a pharase typed from the keyboard.
This is what I wrote:
Code:
using System;
public class YourName
{
public static void Main(string[] args)
{
Console.WriteLine("Enter a word");
string word = Console.ReadLine();
for (int i; i >0; i--)
{
Console.Write(word[i]);
}
}
}
Can you please re-write the code.
Thanks
Comment