TheBulgarianWolf

Printing_20_array_elements

Dec 17th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace jaggedArrays
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int[] array = new int[20];
  14.             for(int i = 0; i < 20; i++)
  15.             {
  16.                 array[i] = i * 5;
  17.             }
  18.  
  19.             foreach(int item in array)
  20.             {
  21.                 Console.Write(" " + item);
  22.             }
  23.             Console.ReadLine();
  24.         }
  25.     }
  26. }
Add Comment
Please, Sign In to add comment