9 October 2013

C# program to print a matrix table from 1 to 20



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[,] tab = new int[20, 10];
            int i, j;
            for (i = 0; i < 20; i++)
            {
                for (j = 0; j < 10; j++)
                {
                    tab[i, j] = (i + 1) * (j + 1);
                    Console.Write("{0}\t", +tab[i, j]);
                }
                Console.WriteLine();
            }
            Console.ReadLine();
        }
    }
}


No comments:

Post a Comment