Thread: Draw a Christmas tree

  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    1

    Draw a Christmas tree

    I need to set up a program which draws a Christmas tree that looks like this:

    #
    ###
    #####
    #######
    I
    I

    Where the user can input any value that is the tree height between 4-20.
    How would i go about setting up a proc that draws the branchlines for the corresponding tree height :/ PLEASE HELP

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Grab a pen and paper and start working on it by hand. Take note of the steps you take. Use this to develop an algorithm, which can then be translated to code. If the code doesn't work as expected, come back here and post it (using proper code tags) with questions, and we can help you further.

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Don't forget about the existence of flow charts, either!
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    In my opinion, a computer is the worst way. Bob Ross: Painting An Evergreen Tree - YouTube

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. christmas tree in c programming using loops.
    By poojaraghoo in forum C Programming
    Replies: 3
    Last Post: 10-09-2011, 02:29 PM
  2. draw tree graph of yacc parsing
    By talz13 in forum C Programming
    Replies: 2
    Last Post: 07-23-2006, 01:33 AM
  3. Christmas Songs
    By Betazep in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 12-21-2001, 07:44 PM
  4. What I Wan't For Christmas!
    By no-one in forum A Brief History of Cprogramming.com
    Replies: 34
    Last Post: 09-26-2001, 05:00 PM