Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. matrix multiplication in 3*3d enter by the user

matrix multiplication in 3*3d enter by the user

Scheduled Pinned Locked Moved C#
data-structuresquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kcal
    wrote on last edited by
    #1

    hi i want to know that there is three loops for matrix multipltication for instance for(i=0;i<3;i++) { for (j=0;j<3;j++) { for(k=0;k<3;k++) know if i want to know abt how i should enter the value in an array and what is the function of theird loop how should i input the value in array 3*3d matrix

    H 1 Reply Last reply
    0
    • K kcal

      hi i want to know that there is three loops for matrix multipltication for instance for(i=0;i<3;i++) { for (j=0;j<3;j++) { for(k=0;k<3;k++) know if i want to know abt how i should enter the value in an array and what is the function of theird loop how should i input the value in array 3*3d matrix

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      If you're declaring a multi-dimensional array (as opposed to a jagged array), then you could do something like this:

      double[,,] matrix = new double[3,3,3];
      for (int i = 0; i < 3; i++)
      for (int j = 0; j < 3; j++)
      for (int k = 0; k < 3; k++)
      matrix[i, j, k] = i * j * k; // Or whatever

      A jagged array wouldn't be a whole lot different, but you'd declare it as double[][][] and reference elements as matrix[i][j][k]. A multi-dimensional array is recommended in this case. You can read more information about the difference by reading about Arrays[^] in the C# Language Specification.

      Microsoft MVP, Visual C# My Articles

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups