+ 1

How to display this table please ?

using System; using System.IO; using System.Linq; using System.Collections.Generic; namespace CSharp_Shell { public static class Program { public static void Main() { string [,] menus = { {"1","Jouer"}, {"2","Paramètres"}, {"3","Quitter"} }; for(int i=0;i<menus.Length;i++) { Console.WriteLine(

quot;{menus[]}"); } } } }

27th May 2019, 11:51 PM
Steve Alzahed
Steve Alzahed - avatar
2 Answers
+ 6
Do you mean the output like this? 1. Jouer 2. Paramètres 3. Quitter If so, try the following code. string [,] menus = { {"1","Jouer"}, {"2","Paramètres"}, {"3","Quitter"} }; int nItems = menus.Length / menus.Rank; for (int i=0; i<nItems; i++) { Console.WriteLine("{0}. {1}", menus[i,0], menus[i,1]); }
28th May 2019, 1:02 AM
r1c5
r1c5 - avatar
+ 1
👊👊👊
28th May 2019, 7:33 AM
Steve Alzahed
Steve Alzahed - avatar