c program to print given number pattern

Write a c program to print given number pattern
1
212
32123
4321234
543212345
65432123456


#include<stdio.h>

int main()
{
  int j,k;
  for(j=1;j<=6;j++)
  {
    for(k=j;k>1;k--)
      printf("%d",k);
    for(k=1;k<=j;k++)
      printf("%d",k);
    printf("\n");
  }
}

Related Posts