I need a program which prints the pattern below. Program must read the number of lines from user.
Example 1:
Input: 3
Output:
#
##
####
Example 2:
**Input: ** 5
Output
#
##
####
#######
###########
The code I have so far:
#include <stdio.h>
int main(int argc, char const *argv[])
{
int n;
scanf("%d", &n);
int step = n;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j+=step) {
printf("#");
}
step--;
puts("");
}
return 0;
}