c box

i m trying to make a graphic image
it is like inside a square a + sighn.
it looks like window with 4 panes.
how to insert the middle line vertically and the end line vertically,
i have reached the stage which makes the letter E.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream.h>
void main()
{
for(int k=1;k<=20;k++)
cout<<" _";


 for (int n=1;n<=10;n++)
 cout<<"\n | ";
  cout<<"\n";

  

 for(int m=1;m<=20;m++)
 cout<<" _";

for (int i=1;i<=10;i++)
 cout<<"\n | ";
  cout<<"\n";

 for(int j=0;j<=20;j++)
  cout<<" _";

 }
main() returns an int.

Basically all you would need to do is add an extra | at the end of every line. You should be able to figure out how to do that.
main should never be void. No questions asked. void main equals crap program no matter how beautiful your code is. No excuses. main is supposed to return int.
http://www.gidnetwork.com/b-66.html
I hate it when people use void main.

@anya:
Well first I would like to tell you that I don't know the c++
but you may get some help from the c code.
I written it only for you.


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
#include<stdio.h>

int main()
{

      for(int k=1;k<=11;k++)
      printf(" -");


      for (int n=1;n<=10;n++)
      printf("\n | %10c %10c", 124, 124);
      printf("\n");

  

      for(int m=1;m<=11;m++)
      printf(" -");

      for (int i=1;i<=10;i++)
      printf("\n | %10c %10c", 124, 124);
      printf("\n");

      for(int j=0;j<=11;j++)
      printf(" -");
      return 0;
  }



Hope you get on the right c++ code.
Topic archived. No new replies allowed.