Pages

Thursday, 17 September 2015

Number Pattern 14

Number pattern 14

Coding:

#include<stdio.h>
int main()
{
 int i,j,n;
 printf("Please enter total number of lines:");
 scanf("%d",&n);
 for(i=n;i>=1;i--)
 {
  printf("\n");
  for(j=i;j<=n;j++)
  {
   printf("%d",j);
  }
  for(j=1;j<i;j++)
       printf("%d",n);
 }
 return 0;
}

Output:
Please enter total number of lines:5

55555
45555
34555
23455
12345