Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleDifferent
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] arr = new int [] { 8, 5, 7, 9 };
- Move(arr);
- }
- static void Move(int[] arr)
- {
- int t = arr.Length;
- int temp = 0;
- for (int i = t-1; i >0; i--)
- {
- temp = arr[t - 1];
- arr[t - 1] = arr[i - 1];
- arr[i - 1] = temp;
- }
- foreach (int elements in arr)
- {
- Console.Write(elements + " ");
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement