CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #3
    Join Date
    Apr 2009
    Posts
    27

    Re: Outputing a square.

    void display()
    {
    char ch;
    int i, j, side;
    cout<<"Enter character and side"<<endl;
    cin>>ch>>side;
    cout<<endl;

    for(int i=0; i<side/2; i++)
    {
    for(int j=0; j<side/2; j++)
    {
    cout<<ch;
    }
    cout<<endl;
    }
    }

    I don't know why you are doing side/2. I think it should just simply be side.
    Last edited by sgsawant; March 23rd, 2010 at 10:43 PM. Reason: I clicked submit accidentally.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured