Advertisement
Alekscho85

MatrixOfNumbers

Oct 26th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. using System;
  2. namespace _09.MatrixOfNumbers
  3. {
  4.     class MatrixOfNumbers
  5.     {
  6.         static void Main()
  7.         {
  8.             Console.Write("Ènter n = ");
  9.             int n = int.Parse(Console.ReadLine());
  10.  
  11.             for (int row = 1; row <= n; row++)
  12.             {
  13.                 for (int col = 1; col <= n; col++)
  14.                 {
  15.                     Console.Write("{0,3}", row + col - 1);
  16.                 }
  17.                 Console.WriteLine();
  18.             }
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement