Advertisement
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;
- using System.Threading.Tasks;
- namespace program
- {
- class populateReversed
- {
- static void Main(string[] args)
- {
- int[] arr = new int[10];
- for(int i = 0; i<arr.Length; i++){
- arr[i] = i;
- }
- reverseArr(arr);
- }
- public static void reverseArr(int[] arr){
- int counter = arr.Length;
- int[] reversedArr = new int[arr.Length];
- for(int i = 0; i<reversedArr.Length; i++){
- reversedArr[i] = counter--;
- }
- foreach(int value in reversedArr){
- Console.WriteLine(value + "\n");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement