taking input of graph in adjacency matrix

PHOTO EMBED

Fri Jul 29 2022 09:45:12 GMT+0000 (Coordinated Universal Time)

Saved by @shimeibro #c++

  int e,v;
    cin>>v>>e;
    int** arr = new int*[v];
    for(int i = 0; i<v; i++){
        arr[i] = new int [v];
        for(int j = 0; j<v; j++){
            arr[i][j] = 0;
        }
    }
    int x, y;
     for(int i = 0; i<e; i++){
         cin>>x>>y;
         arr[x][y] = 1;
         arr[y][x] = 1;
     }
    
content_copyCOPY

to take input of graph