Click here to Skip to main content
15,867,990 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C#
u<sing System;

namespace multi_dimensional_array
{
  class Program
   {
     static void Main(string[] args)
      {
        int i, j;
        //Declaring multi dimensional array
        string[,] Books = new string[3,3];
        for (i = 0; i < 3; i++)
         {
           for (j = 0; j < 3; j++)
            {
              Console.Write("\nEnter Book Name for {0}.                   Row and {1}. column:\t",i+1,j+1);
              Books[i,j] = Console.ReadLine();
            }
         }

        Console.WriteLine("\n\n=========================");
        Console.WriteLine("All the element of Books array            is:\n\n");

        //Formatting Output
        Console.Write("\t1\t2\t3\n\n");
        //outer loop for accessing rows
        for (i = 0; i < 3; i++)
         {
           Console.Write("{0}.\t", i + 1);

           //inner or nested loop for accessing column                of each row
           for (j = 0; j < 3; j++)
            {
              Console.Write("{0}\t", Books[i,j]);
            }
           Console.Write("\n");
         }
        Console.WriteLine("\n\n=========================");
        Console.ReadLine();
      }
   }
}
Posted
Updated 17-Oct-13 23:42pm
v2
Comments
OriginalGriff 18-Oct-13 5:46am    
What's the problem?
At present this is just a random piece of code with no question attached to it.
What do you need help with? What have you tried? Where are you stuck?
Member 10344033 18-Oct-13 7:27am    
i have run this programme in C# .net so i, how to run it ???
OriginalGriff 18-Oct-13 7:39am    
Compile it an execute in the debugger or otherwise.

I can't help feeling that we are talking at cross purposes.
Perhaps if you try explaining at length, and maybe an example?
Remember, I can't see your screen, or access your HDD, so you need to give me plenty of information.
Ranjan.D 21-Oct-13 10:19am    
The only problem I see is the first line of using statement.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900