How to draw a box

This is a discussion on How to draw a box within the C Programming forums, part of the General Programming Boards category; Hello .. I'm new to C n this forum.. I need to draw a box from user in put Box ...

  1. #1
    Registered User
    Join Date
    Jun 2013
    Posts
    1

    How to draw a box

    Hello .. I'm new to C n this forum..
    I need to draw a box from user in put
    Box width: 4
    Box height: 3

    then it need to draw something like this

    Code:
    ----
    |  |
    ----
    When the hight is 3 I prints one '|', because .. First and Last '|' been replaced with space.. (For example if the hight is 5 then only 3 '|' print)

  2. #2
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,675
    Try using a for loop and the post your attempt.

    Welcome to the forum.

    Remember to always wrap the code in code tags.
    Code - functions and small libraries I use


    Itís 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " óHarold Abelson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How Can I draw What I want?
    By CChakra in forum Game Programming
    Replies: 22
    Last Post: 09-11-2008, 08:38 AM
  2. Draw dot by dot?
    By fiska in forum C# Programming
    Replies: 3
    Last Post: 10-11-2006, 09:38 AM
  3. With what to draw?
    By LMZ in forum C# Programming
    Replies: 0
    Last Post: 07-06-2006, 08:24 AM
  4. My 1st MFC - Draw
    By geek@02 in forum Windows Programming
    Replies: 2
    Last Post: 05-08-2004, 09:51 PM
  5. draw
    By loki_cmr in forum C++ Programming
    Replies: 7
    Last Post: 11-30-2002, 09:34 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21