bsc

Comprehensive codebase and cou...
Log | Files | Refs | Activity | README | LICENSE

root / semester_1 / letusc / luc042.c

luc042.c (730B)


      1 /* Write a program to produce the following output :
      2             1
      3         2       3
      4     4       5       6
      5 7       8       9       10
      6 */
      7 
      8 /* Let Us C, Chap- 6, Page - 106, Qn No.: B(i) */
      9 
     10 #include <stdio.h>
     11 int main()
     12 {
     13     int starter = 1;
     14     int tab = 3;
     15     printf("The pattern : \n");
     16     for (int i = 1; i <= 4; i++)
     17     {
     18         int count = 0;
     19         for (int k = 1; k <= tab; k++)
     20         {
     21             printf("    ");
     22         }
     23         tab = tab - 1;
     24         for (int j = starter; j <= 10; j++)
     25         {
     26             if (count >= i)
     27             {
     28                 break;
     29             }
     30             printf("%d       ", j);
     31             count++;
     32             starter++;
     33         }
     34         printf("\n");
     35     }
     36     return 0;
     37 }
© notamitgamer • Site Built: 2026-09-05 01:53:16 UTC • git-mirror commit: c170d72 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror