I am trying to create a shape in the form of:
****
***
**
*
**
***
****
I got this shape:
****
***
**
*
using a recursion function but I have been beating myself in the head trying to figure out the rest of it:
Any clues?
program output so far is:Code:#include <cstdlib> #include <iostream> using namespace std; int design(int); int main(int argc, char *argv[]) { design(4); system("PAUSE"); return EXIT_SUCCESS; } int design(int x) { int i; int j = 3; for(i =0; i < x; i++) cout << "*"; cout << endl; if(x == 0) return 1; else design(x - 1);
****
***
**
*



LinkBack URL
About LinkBacks


