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


  1. using System;
  2.  
  3. namespace Sort_Array
  4. {
  5. public class Program
  6. {
  7. public static void Main(string[] args)
  8. {
  9. int[] num= {22,50,11, 2, 49};
  10. Array.Sort(num);
  11. for(int i=0; i<num.Length; i++)
  12. {
  13. Console.Write(num[i] + " ");
  14. }
  15. }
  16. }
  17. }

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.
 

Share your thought