bsc

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

luc042.c (866B)


      1 /*
      2  * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025
      3  * Repo: https://github.com/notamitgamer/bsc
      4  * License: MIT
      5  */
      6 
      7 /* Write a program to produce the following output :
      8             1
      9         2       3
     10     4       5       6
     11 7       8       9       10
     12 */
     13 
     14 /* Let Us C, Chap- 6, Page - 106, Qn No.: B(i) */
     15 
     16 #include <stdio.h>
     17 int main()
     18 {
     19     int starter = 1;
     20     int tab = 3;
     21     printf("The pattern : \n");
     22     for (int i = 1; i <= 4; i++)
     23     {
     24         int count = 0;
     25         for (int k = 1; k <= tab; k++)
     26         {
     27             printf("    ");
     28         }
     29         tab = tab - 1;
     30         for (int j = starter; j <= 10; j++)
     31         {
     32             if (count >= i)
     33             {
     34                 break;
     35             }
     36             printf("%d       ", j);
     37             count++;
     38             starter++;
     39         }
     40         printf("\n");
     41     }
     42     return 0;
     43 }
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror