MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

CPP/array-2d/array.cpp:3–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include<bits/stdc++.h>
2using namespace std;
3int main(){
4 int n,m;
5 cin>>n>>m;
6 // char arr[n];
7 // for (int i = 0; i < n; ++i)
8 // {
9 // cin>>arr[i];
10 // }
11 // for (int i = 0; i < n; ++i)
12 // {
13 // cout<<arr[i];
14 // }
15
16
17 //2D array
18 int arr[n][m];
19 for (int i = 0; i < n; ++i)
20 {
21 for (int j = 0; j < m; ++j)
22 {
23 cin>>arr[i][j];
24 }
25 }
26 for (int i = 0; i < n; ++i)
27 {
28 for (int j = 0; j < m; ++j)
29 {
30 cout<<arr[i][j]<<" ";
31 }
32 cout<<endl;
33 }
34 return 0;
35}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected