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 / tuition-c / P048.c

P048.c (442B)


      1 /* Make this pattern for input n no of row.
      2     Pattern :
      3     1
      4     2   3   
      5     4   5   6
      6     7   8   9   10
      7     11  12  13  14  15   
      8 */
      9 
     10 #include <stdio.h>
     11 
     12 int main()
     13 {
     14     int i, j, n, temp = 1;
     15     printf("Enter row number : ");
     16     scanf("%d", &n);
     17     for (i = 1; i <= n; 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 }