Pattern 2

Description:

Write a program to print the given pattern. Input Format: Input consists of a single integer. Output Format: Refer sample outputs. There is a trailing space at the end of each line. Sample Input: 5 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5

Program :

#include<stdio.h>
int main(){
  int n,i=1,j=1;
  scanf("%d",&n);
  for(i=1;i<=n;i++)
  {
    for(j=i;j<=n;j++)
    {
      printf("%d ",j);
    }
    
    printf("\n");
  }
  return 0;
}