In this type of program we always find how many column present in a particular row. Because we know that we are always print in VDU horizontally. Here column number is same as row number and as spaces are present at the right side of the character then we can ignore it. It is Left Side Triangle.
#include <stdio.h> int main() { int r,c,n; printf("Enter Total Number of row : "); scanf("%d",&n); for(r=0;r<n;r++) { for(c=0;c<=r;c++) { printf("*"); } printf("\n"); } return 0; }
Enter Total Number of row : 6
* ** *** **** ***** ******