Complete the staircase function below.
| 5 | |
| 6 | // Complete the staircase function below. |
| 7 | void staircase(int n) { |
| 8 | //first loop is used to make rows |
| 9 | for (int i = 0 ; i <n ; i++) { |
| 10 | //second loop is used to make columns |
| 11 | for (int j=n-1 ; j>=0; j--){ |
| 12 | |
| 13 | if (j==i){ |
| 14 | cout << ("#"); |
| 15 | } |
| 16 | else if(j<i){ |
| 17 | cout << ("#"); |
| 18 | } |
| 19 | else { |
| 20 | cout<<(" "); |
| 21 | } |
| 22 | } |
| 23 | cout <<('\n'); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | int main() |
| 28 | { |