50. Pattern 3

Image result for c programming
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1
Code:
  #include<stdio.h>
int main(){
  int n,i=0,j=0,k=0;
  scanf("%d",&n);
  k=n;
  for (i=1;i<=k;i++)
  {
    for(j=n;j>0;j--)
    {
      printf("%d ",j);
    }
  printf("\n");
    n--;
  }
  return 0;
}

No comments