forum.venkateswarlu.net
      Register      Login
C# program for matrix result with first row and first column having same values

1 replies to this topic

Laxman B #1
Member
42 Points
Posted on 22 Sep 2014 01:19 PM IST
Console.WriteLine("Please enter number:");

            string number = Console.ReadLine();

            int a = 0;

            if (Int32.TryParse(number, out a))
            {
                int n = Convert.ToInt32(number);

                for (int b = 0; b <= n; b++)
                    Console.Write("**");
                Console.WriteLine("");
                for (int i = 1; i <= n; i++)
                {
                    int temp = i;
                    int t = 0;
                    for (int j = 1; j <= n; j++)
                    {

                        if (i > n)
                        {
                            Console.Write(++t + " ");
                        }
                        else

                            Console.Write(i++ + " ");
                    }
                    Console.WriteLine("");
                    i = temp;
                }

                for (int c = 0; c <= n; c++)
                    Console.Write("**");
            }
            else
                Console.WriteLine("You enter value not interger..!");

            Console.ReadLine();
 
C#.NET     998 views     Reply to this topic
Kamalesh Kumar #2
Member
30 Points
Replied on 18 Feb 2016 12:27 PM IST Often it's necessary to figure with the rows or columns of a matrix as vectors. the acute improvement arithmetic Library for .NET includes 3 choices for doing this.

The row and column vectors came by these mechanisms area unit derived vectors. Any modification to a element of the vector can modification the corresponding element of the matrix. Conversely, any modification to a element of the matrix can modification the corresponding element within the row or column vector. to create the row or column vector complete, decision its CloneData technique.In each case, the foremost economical vector sort is came. as an example, the rows and columns of a DenseMatrix area unit of sort DenseVector. The rows and columns of a TriangularMatrix area unit of sort BandVector.Indexed vary accessThe trained worker property is full to permit for direct indexed access to finish or partial rows or columns. within the overloads, the row or column index is replaced with a spread structure. The come price may be a Vector&lt; T&gt; that points to the desired place the desired row or column. The special vary All allows you to access a whole row or column while not having to specify any details concerning the vary. 
Reply to this topic