Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. using System;
  2.  
  3. namespace NameOfYourProgram
  4. {
  5. class StringReverse
  6. {
  7. static void Main()
  8. {
  9. string str = "", reverse = "";
  10. int Length = 0;
  11. Console.WriteLine("Enter a Word");
  12. str = Console.ReadLine();
  13. Length = str.Length - 1;
  14. for (int i = 0; i < str.Length; i++)
  15. {
  16. int index = str.Length - i - 1;
  17. reverse += str[index];
  18. }
  19. Console.WriteLine("Reverse word is {0}", reverse);
  20. Console.ReadLine();
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement