I am writing a program to print 2 boxes like given in this figure: 
[![enter image description here](https://i.stack.imgur.com/pnswj.png)](https://i.stack.imgur.com/pnswj.png)

I tried the below program but it is not giving the expected output. 

```
#include<iostream>

using namespace std;

int main()
{
    // Considering each box as a separate one
    for(int i = 1; i <= 2; i++)
    {           
    cout << "+---+ " << endl;
    cout << "|  " << i << "| " << endl;
    cout << "|   | " << endl;
    cout << "|   | " << endl;
    cout << "+---+ ";
    }

    return 0;
}

```

The output I am getting: 

```
+---+ 
|  1| 
|   | 
|   | 
+---+ +---+ 
|  2| 
|   | 
|   | 
+---+

```

Please help me where I am missing things. 
Any help or hint would be highly appreciated.