-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtwoDarray.cpp
More file actions
48 lines (36 loc) · 715 Bytes
/
Copy pathtwoDarray.cpp
File metadata and controls
48 lines (36 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include<iostream>
using namespace std;
int main()
{
//assignment
int arr[3][4];
// int arr[3][4]={1,2,3,4,5,6,7,8,9,10,11,12};
// int arr[3][4] = {{1,11,111,1111},{2,22,222,2222},{3,33,333,3333}};
//taking input -> row wise
for(int i=0;i<3;i++){
for(int j=0;j<4;j++){
cin>>arr[i][j];
}
}
//printing-> row wise
// for(int i=0;i<3;i++){
// for(int j=0;j<4;j++){
// cout<<arr[i][j]<<" ";
// }
// cout<<endl;
// }
//taking input -> col wise
// for(int i=0;i<4;i++){
// for(int j=0;j<3;j++){
// cin>>arr[j][i];
// }
// }
//printing
for(int i=0;i<3;i++){
for(int j=0;j<4;j++){
cout<<arr[i][j]<<" ";
}
cout<<endl;
}
return 0;
}