Sorting numbers

I am trying to write a solution that will take input from the user and provide an output after sorting it. i,e. if anyone gives input as 654321 my program will return 123456. Below is the code I have written so far. But it is returning the same without sorting. What mistake I am doing here?

    static void Main(string[] args)
        Console.WriteLine("Enter your number: ");
        int input = Convert.ToInt32(Console.ReadLine());

        int[] array = new[] {input};


        foreach (var value in array)


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!