bsc

Comprehensive codebase and coursework for the 4-year B.Sc. Computer Science Honours degree (WBSU)

git clone https://github.com/notamitgamer/bsc.git
· rebuilt hourlyOpen on GitHub
root / semester_1 / practice-c / pc002.c

pc002.c (393B)


      1 /* Pattern :
      2     1   2   3   4   5
      3     6   7   8   9
      4     10  11  12
      5     13  14
      6     15
      7 for n = 5
      8 */
      9 
     10 
     11 #include <stdio.h>
     12 int main()
     13 {
     14     int i, j, n, temp = 1;
     15     printf("Enter n : ");
     16     scanf("%d", &n);
     17     for (i = n; i >= 1; i--)
     18     {
     19         for (j = 1; j <= i; j++)
     20         {
     21             printf("%d\t", temp);
     22             temp++;
     23         }
     24         printf("\n");
     25     }
     26     return 0;
     27 }