SHARE
TWEET

Print Numbers in Reverse Order (Arrays)

GalyaHristova Dec 13th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace Lab_02_Print_Numbers_Reverse_Order
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.  
  11.             int[] numbers = new int[n];
  12.  
  13.             for (int i = 0; i < n; i++)
  14.             {
  15.                 int number = int.Parse(Console.ReadLine());
  16.                 numbers[i] = number;
  17.             }
  18.  
  19.             for (int i = numbers.Length - 1; i >= 0; i--)
  20.             {
  21.                 Console.Write(numbers[i] + " ");
  22.             }
  23.         }
  24.     }
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top