I want to print an X shape using `n` number of rows but without any loop. I have to use a recursive function to print the X.

I have called the functions along with space function but it didn't print the X. It printed:

```
*   *
 *  *
  * *

```

I have to solve this problem using recursion. No `for` loop or `while` loop is allowed to solve this one.

```
// C++ implementation to print the given
// pattern recursively
#include <bits/stdc++.h>

using namespace std;

// function to print the 'n-th' row of the
// pattern recursively
int g;

void printPatternRowRecur(int n) {
    if (n < 1)
        return;

    if (n = 1) {
        cout << "*";
    }
    // print the remnaining stars of the n-th row
    // recursively
    else {
        return;
    }
    printPatternRowRecur(n - 1);
}

void print_space(int space) {
    // base case
    if (space == 0)
        return;
    cout << " ";

    // recursively calling print_space()
    print_space(space - 1);
}

int s;

void Rhombus(int n) {
    // base condition
    if (s >= n)
        return;
    else {
       print_space(s);
       printPatternRowRecur(n);
       print_space(n - s);
       printPatternRowRecur(n);
    }
    // print the stars of the n-th row
    s++;
    // move to next line
    cout << endl;
    // print stars of the remaining rows recursively
    Rhombus(n);
}

 // Driver program to test above
int main() {
    int n = 3;
    //cout << "Enter the number of lines you want to print" << endl;
    //cin >> n;
    //cout << endl << "Rhombus" << endl;
    Rhombus(n);
    return 0;
}

```