Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace NameOfYourProgram
- {
- class StringReverse
- {
- static void Main()
- {
- string str = "", reverse = "";
- int Length = 0;
- Console.WriteLine("Enter a Word");
- str = Console.ReadLine();
- Length = str.Length - 1;
- for (int i = 0; i < str.Length; i++)
- {
- int index = str.Length - i - 1;
- reverse += str[index];
- }
- Console.WriteLine("Reverse word is {0}", reverse);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement