Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ArrayofElements
- {
- class Program
- {
- static void Main(string[] args)
- {
- int [] arr = new int[10];
- Console.WriteLine("Enter the elements");
- for (int i = 0; i < arr.Length; i++)
- {
- arr[i] = int.Parse(Console.ReadLine());
- }
- Console.WriteLine("Array Elements are: ");
- for (int i = 0; i < arr.Length; i++)
- {
- Console.Write(" {0} ", arr[i]);
- }
- Array.Reverse(arr);
- Console.WriteLine("\nReversed Array :");
- foreach (int i in arr)
- {
- Console.Write(" {0} ", i);
- }
- Array.Sort(arr);
- Console.WriteLine("\nSorted Array :");
- foreach (int i in arr)
- {
- Console.Write(" {0} ", i);
- }
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment