0

Multi-Dimensional Arrays

Type in a code to declare a multidimensional array with 2 rows and 3 columns. Enter the value using cin for the element in the second column of the second row. int arr[2][ ]; cin >> arr[ ][ ];

1st Oct 2018, 12:47 PM
Panji Darmawan
Panji Darmawan  - avatar
6 ответов
+ 4
This is Solution : Don't forget to Upvote ................................................... using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { int[,] num = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } }; //your code goes here for(int i=0; i<3;i++) { for(int j=0;j<3;j++) { Console.WriteLine(num[i,j]); } } } } }
26th Aug 2021, 7:11 AM
Khan Baz Khan Jadoon
Khan Baz Khan Jadoon - avatar
+ 2
int arr[2][3 ]; cin >> arr[1 ][1 ];
16th May 2020, 3:51 PM
gssfshshjs
+ 1
Two -Dimensional Arrays cout << arr[ 0 ][ 1 ] <<endl; ans: 0 and 1
10th Dec 2021, 3:20 AM
Benmar N. Sibonga
Benmar N. Sibonga - avatar
0
answer 3 1 1
10th Dec 2021, 3:22 AM
Benmar N. Sibonga
Benmar N. Sibonga - avatar
0
int arr[2][3 ]; cin >> arr[ 1][1 ];
23rd Jul 2023, 3:43 PM
Aditya Rangari
Aditya Rangari - avatar
- 2
Panji Darmawan where you are stuck? just declare array of two dimensions [][] like this and consider first aa row and second as column... use two for loop to have user input with help of cin
4th Oct 2018, 1:42 AM
Ketan Lalcheta
Ketan Lalcheta - avatar