Ascending Order In C#

Step 1. Open Visual Studio 2015.

visual studio 2015

Step 2. Click New Project and open Console Application. Give any name in the name box.

console application

Step 3. Declare number of arrays and arrange in an ascending order by using the code.

  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Text;  
  5. using System.Threading.Tasks;  
  6. namespace Ascending_Order  
  7. {  
  8.     class Program {  
  9.         static void Main(string[] args) {  
  10.             Console.Write("Ascending Order is : ");  
  11.             int[] a = {  
  12.                 90,  
  13.                 80,  
  14.                 85,  
  15.                 95,  
  16.                 35,  
  17.                 30,  
  18.                 55,  
  19.                 70  
  20.             };  
  21.             Array.Sort(a);  
  22.             foreach(int value in a) {  
  23.                 Console.Write(value);  
  24.                 Console.Write(' ');  
  25.             }  
  26.             Console.ReadLine();  
  27.         }  
  28.     }  
  29. }  
Step 4. Your final output is given below-

Output