Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // sorce : http://www.dotnetperls.com/array-sort
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace TestSomeShits
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Enter array length: ");
- int length = int.Parse(Console.ReadLine());
- int[] myArray = new int[length];
- //enter array elements
- for (int i = 0; i < myArray.Length; i++)
- {
- Console.Write("Number {0} = ", i + 1);
- myArray[i] = int.Parse(Console.ReadLine());
- }
- Array.Sort(myArray);
- Console.WriteLine();
- Console.WriteLine("THE SORTED ARRAY IS :");
- for (int i = 0; i < myArray.Length; i++)
- {
- Console.WriteLine("Number {0}= {1}",i+1,myArray[i]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement