Quantcast
Channel: C# code
Viewing all articles
Browse latest Browse all 2

C# code

$
0
0


The code is supposed to multiply a matrix by a scalar value and then print it out to the Matrix to the Console....

I know that a double Array is used and then each of the values of a is multiplied by b....

What does the code do after the a*= b; line?

Is StringWriter some type of a function and strOut is the name of it? (Also, there is some type of error in the code, can you identify it?). Thanks in advance.

static void Main() {

   double[,] a;
   a = new double[,] { { 1, 2, 5 }, { 7, -3, 8 } };
   double b = 2.3;

a *= b;

   StringWriter strOut = new StringWriter();
   strOut.Write("Matrix is:");
   for (int i = 0; i < a.GetLength(0); i++)
   {
      strOut.WriteLine();
      for (int j = 0; j < a.GetLength(1); j++)
      {
          strOut.Write("{0,9:f3}", a[i, j]);
      }

}

   Console.WriteLine(strOut.ToString());
}


Viewing all articles
Browse latest Browse all 2

Latest Images

Pangarap Quotes

Pangarap Quotes

Vimeo 10.7.0 by Vimeo.com, Inc.

Vimeo 10.7.0 by Vimeo.com, Inc.

HANGAD

HANGAD

MAKAKAALAM

MAKAKAALAM

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Trending Articles


Tiburon para colorear


Gwapo Quotes : Babaero Quotes


Winx Club para colorear


Girasoles para colorear


Dibujos de animales para imprimir


Renos para colorear


mayabang Quotes, Torpe Quotes, tanga Quotes


Love Quotes Tagalog


Tagalog Love Facts About Men


Mga Tala sa “Unang Siglo ng Nobela sa Filipinas” (2009) ni Virgilio S. Almario





Latest Images

Pangarap Quotes

Pangarap Quotes

Vimeo 10.7.0 by Vimeo.com, Inc.

Vimeo 10.7.0 by Vimeo.com, Inc.

HANGAD

HANGAD

MAKAKAALAM

MAKAKAALAM

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC