Print numbered inverted right angle triangle pattern - C

Write a C program to display following pattern:

numbered inverted triangle

Solution:

#include<stdio.h>
int main()
{
      int i,a;
      for(a=8;a>=5;a--)
      {
            for(i=5;i<=a;i++)
            printf("%d ",i);  /*Here, we left the space after %d. It affects the space between each number while printing.*/
            printf("\n");
      }
      return 0;
}


Output:

numbered inverted right angle triangle