Search C Program | nimishsoft@gmail.com

Number Pattern - 38

  1  2  3  4  5
  6  7  8  9
 10 11 12
 13 14
 15

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


Related Links:
- More Number Pattern Programs
- Star Pattern Programs in C
- Alphabet Pattern Programs in C
- Series Programs in C


3 comments:

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

    ReplyDelete
  2. I don't think comment above is correct

    ReplyDelete