{0,4} {1,4} {2,4} {3,4} {4,4} : String Format : Data Types C# Source Code


Custom Search

C# Source Code » Data Types » String Format »

 

{0,4} {1,4} {2,4} {3,4} {4,4}








    
 
using System;

public class MainClass {
    public static void Main() {
        Random rnd = new Random();
        int[,] m = new int[3, 5];
        for (int i = 0; i < m.GetLength(0); i++)
            for (int j = 0; j < m.GetLength(1); j++)
                m[i, j] = rnd.Next(1000);

        for (int i = 0; i < m.GetLength(0); i++)
            Console.WriteLine("{0,4} {1,4} {2,4} {3,4} {4,4}", m[i, 0], m[i, 1], m[i, 2], m[i, 3], m[i, 4]);

    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Data Types
» String Format