as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
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