Problem: I am trying to find a less verbose way to achieve the following code block. The code must create a decreasing pattern of stars using nested loops, and must pass a reference to a function. This is as concise as I've managed so far:

```
#include <iostream>
using namespace std;

void printStars(int &);

int main( ) {
    int maxNum = 0;
    cout << "Enter a number: ";
    cin >> maxNum;

    for (int row = maxNum; row > 0; row--) {
        printStars(row);
        cout << endl;
    }
}

void printStars(int &num) {
    for(int col = num; col > 0; col--)
        cout << "*";
}

```

The above works, but it seems like there should be a much more efficient way to do this using references and functions. Any ideas?

This was given to my daughter's class as a quiz exercise. I attempted to leave the original question out, but have decided to post it for reference. It is not worded well.

> 
> Create a pass by reference function call void showPattern(int &) with
>  one parameter. Make the function call in main(). Accept input into int
>  main() of an integer value called highNumber. The high number of the
>  pattern is based on the cin >> input of the user via the function
>  (don't worry about validation). maxNum as a parameter in Main to the
>  function. In function definition, using nested loops display the
>  following pattern:
> 
> 
> 

```
*********
********
*******
******
*****
****
***
**
*

```