Write a program to sort one dimensional array in ascending order using static method

Qu. Write a program to sort one dimensional array in ascending order using static method
Answer


using System;

namespace Sort_Array
{
    public class Program
    {
        public static void Main(string[] args)
        {
            int[] num= {22,50,11, 2, 49};
            Array.Sort(num);
            for(int i=0; i<num.Length; i++)
            {
                Console.Write(num[i] + " ");
            }
        }
    }
}

Output
2 11 22 49 50 _

More Example

Write A Program To Print One Dimensional Array In Reverse Order
Write A Program To Sort One Dimensional Array In Descending Order Using Non Static Method.
Write A Program To Sort One Dimensional Array In Desending Order Static Class Array Method.
Write A Program To Sort One Dimensional Array In Ascending Order Using Non Static Method.
Write A Program To Sort One Dimensional Array In Ascending Order Using Static Method.
Write A Program To Add The Diagonal Of Two-Dimensional Array.

More Articles

 

Share your thought



PLEASE DISABLE ADBLOCKER AND SUPPORT US!

Please support us by enabling ads on this page. Refresh

YOU DON'T LIKE ADS, WE ALSO DON'T LIKE ADS!
 
But we have to show ads on our site to keep it free and updated. We have to pay huge server costs, domain costs, CDN Costs, Developer Costs, Electricity and Internet Bill. Your little contribution will encourage us to regularly update this site.