/*Write a program in C to print the following pattern: 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 */ #include int main () { int n, i, j, k; printf ("\nEnter the total number of lines: "); scanf ("%d", &n); for (i=1; i<=n; i++) //outer for loop i => maintains line no. { printf ("\n"); for (j=1; j<=n-i; j++) //inner for loop j => nos. in each line { printf (" "); //placed 2 bar space after each no. } for (k=1; k<=i; k++) printf ("%d ", k);// } return 0; }