Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class ReverseStringLetters
- {
- //Write a program that reads a string, reverses it and prints the result at the console.
- //Example: "sample" -> "elpmas".
- static void Main()
- {
- Console.WriteLine("Enter a string to reverse: ");
- string input = Console.ReadLine();
- for (int i = input.Length - 1; i >= 0; i--)
- {
- Console.Write(input[i]);
- }
- Console.WriteLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement