Write a recursive function that draws the following figure for n= 4
****
***
**
*
**
***
****
Note: I need help to write out this problem in C++ whileusing Visual Studio 2017
Solution
#include<iostream>#include<string.h>using namespace std;void print(int n){ if(n>0){ cout<<“*”; print(n-1); }}void printPattern(int n, int i, bool flag){ if(i == n+1){ return; } else{ print(i); cout<<endl; if(i == 1)
OR
OR