Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Reversed
- {
- class Reversed
- {
- static void Main(string[] args)
- {
- //takes input
- Console.WriteLine("Enter a string:");
- string input = Console.ReadLine();
- //converts the input to char array
- char[] inputArr = input.ToCharArray();
- //reverses the char array
- Array.Reverse(inputArr);
- string input2 = new string(inputArr);
- Console.WriteLine(input2);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement