triangle recursive function

This is a discussion on triangle recursive function within the C++ Programming forums, part of the General Programming Boards category; Can anybody help me solve this problem??Thank You. Write a complete C++ program which contains a recursive function to print ...

  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    1

    triangle recursive function

    Can anybody help me solve this problem??Thank You.

    Write a complete C++ program which contains a recursive function to print a triangle filled with character.

    Write the prototype of prtTriangle as
    void prtTriangle (int n, char ch);
    By calling prtTriangle(9,'@') from the main function, the output is printed as follows:
    @
    @@
    @@@
    @@@@
    @@@@@
    @@@@@@
    @@@@@@@
    @@@@@@@@
    @@@@@@@@@
    @@@@@@@@@@
    @@@@@@@@@
    @@@@@@@@
    @@@@@@@
    @@@@@@
    @@@@@
    @@@@
    @@@
    @@
    @

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    23,801
    What have you tried?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Make Recursive function 'Tail-Recursive'
    By dp2452 in forum C Programming
    Replies: 7
    Last Post: 12-04-2009, 09:13 AM
  2. Compiling C in Visual Studio 2005
    By emanresu in forum C Programming
    Replies: 3
    Last Post: 11-16-2009, 03:25 AM
  3. recursive function
    By technosavvy in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 04:42 AM
  4. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 06:18 AM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM

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