Thread: c program

  1. #1
    Registered User
    Join Date
    Aug 2012
    Location
    Espérance Trébuchet, Riviere Du Rempart, Mauritius, Mauritius
    Posts
    1

    c program

    am new so please help me.....
    am asked to "write a program that displays the outline of a box five characters wide and five characters tall. Use the '*' character for the box outline."

  2. #2
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    So if you have a character people can see, (*) and a character that people can't see ( ) can you arrange them in a box shape with code?

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Welcome to the forum, UniPrek!

    I won't give you any code, because this is too good of a puzzle (which will help improve your ability to think through these puzzles). But I'll ask you to tell me the two types of lines of print you need to use, to make up your box. What would they be?

    As with all these puzzles, it helps a lot if you work through them slowly, and thoughtfully, by hand first, with a very simple and small example. Note how YOU would draw a box like this, if you were only drawing from top to bottom rows, and from left to right columns. Like a computer would.

    Repeat it a few times and you'll begin to notice a pattern - and that pattern, when it's simplified into small steps, can form the basis of your program's logic.

    Even if you feel lost, have confidence. You WILL improve substantially, at solving these little problems, with practice.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 07-14-2012, 09:43 AM
  2. Replies: 1
    Last Post: 03-03-2009, 04:47 PM
  3. Replies: 5
    Last Post: 08-16-2007, 11:43 PM
  4. Replies: 18
    Last Post: 11-13-2006, 01:11 PM
  5. Math Equation Program (I can't find the problem with my program!)
    By masked_blueberr in forum C Programming
    Replies: 14
    Last Post: 07-06-2005, 11:53 AM