Advertisement
Atanasov_88

Untitled

Oct 1st, 2015
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Text;
  4. using System.Collections;
  5.  
  6.     class Program
  7.     {
  8.         static void Main()
  9.         {
  10.             int size = 3;
  11.             int[,] matrixArray = new int[3, 3];
  12.             int counter = 1;
  13.          
  14.             for (int i = 0; i < size; i++)
  15.             {
  16.                 for (int j = 0; j < size; j++)
  17.                 {
  18.                     matrixArray[i, j] = counter;
  19.                     counter++;
  20.  
  21.                     Console.Write("|"+ matrixArray[i,j] + " " + "|");
  22.                 }
  23.              
  24.                 Console.WriteLine();
  25.                
  26.             }
  27.         }
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement