recent

Write a c program to print given number pattern

Write a c program to print given number pattern
1
121
12321
1234321
123454321

#include<stdio.h>

int main()
{
  int k,j;
  for(k=1;k<=5;k++)
  {
    for(j=1;j<=k;j++)
      printf("%d",j);
    for(j=k-1;j>=1;j--)
      printf("%d",j);
    printf("\n");
}
}  
Powered by Blogger.