+ 5
Input data into 2d array
I want to create a program were a user enters data into a 2d array using for loops, then display the results
2 Answers
+ 15
int array[5][5];
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; j++)
{
//codes
cin>>array[i][j];
}
}
+ 4
For Python ...
d1 = []
for i in range(size_of_outer_array):
d2 = []
for j in range(size_of_inner_array):
x = input()
d2.append(x)
d1.append(d2)
print d1 #prints the array