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
    21,717
    What have you tried?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    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