Code Scrappers


1 to 20 numbers pyramid pattern C program


              #include<stdio.h>
              #include<stdlib.h>

              void main()
              {
                 int i, j, flag = 1;

                 for (i = 0; i <= 6; i++)
                 {
                      printf("\n");

                      for (j = 0; j < i; j++)
                      {
                          printf("%d\t", flag);

                          flag++;
                      }
                 }
              }




          



Output

    1
    2       3
    4       5       6
    7       8       9       10
    11      12      13      14      15
    16      17      18      19      20      21