Run ❯
Get your
own C#
server
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
using System; namespace MyApplication { class Program { static void Main(string[] args) { string word1 = "listen"; string word2 = "silent"; char[] chars1 = word1.ToCharArray(); char[] chars2 = word2.ToCharArray(); Array.Sort(chars1); Array.Sort(chars2); if (new string(chars1) == new string(chars2)) { Console.WriteLine("The words are anagrams"); } else { Console.WriteLine("The words are not anagrams"); } } } }
The words are anagrams