Create a program that prints the following pattern:
user
#include<iostream> 
  
using namespace std; 
  
void pattern(int n) 
{ 
    int i, j; 
   
    // outer loop to handle number of rows 
    for (i = 0; i < n; i++) { 
  
        // inner loop to handle number of columns  
        for (j = 0; j <= i; j++) { 
            // printing stars 
            cout << "* "; 
        } 
  
        // ending line after each row 
        cout << endl; 
    } 
} 

// Driver function 
int main() 
{ 
    int n = 5; 
    pattern(n); 
    return 0; 
}
assistant