Given the number of rows, use a while loop to print the following pattern.
For rows = 2, the pattern should print like this:
*
**
For rows = 4, the pattern should print like this:
*
**
***
****
rows will always be a positive integer.
function printPattern(rows){
// write your code here
}
printPattern(2);
printPattern(4);