/*Write a program in C to print the following pattern: 1 2 3 3 4 5 4 5 6 7 5 6 7 8 9 */ #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 loop i => maintains line no. { k = i; /*starts line with value = current line no., starting of line (k) = line no. (i)*/ printf ("\n"); for (j=1; j<=i; j++) //nested loop j => nos. in each line { printf (" %d ",k); //placed 1 bar space after each no. k++; } } return 0; }