A problem with a solution via using progarming C

Bismillahir Rahmanir Rahim

write a program to print the below picture-
user input a single integer.
Solution

1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include<stdio.h>
void main()
{
 int i,j,k,l,m,n,a,b,c,x,y;
 printf("Enter a single integar number:");
 scanf("%d",&n);
 a=n;
        y=n;
 for(i=a;i>=1;i--)
  {
   for(j=1;j<=i;j++)
    {
     printf("%d",j);     
    }
    for(l=a;l>i;l--)
            printf("  ");
      for(k=i;k>=1;k--)
      {
       printf("%d",k);
      }          
    printf("\n");
   }
   for(m=1;m<=a;m++)
   {
    for(n=1;n<=m;n++)
     {
      printf("%d",n);
     }
     for(b=a;b>m;b--)
       printf(" ");
     for(x=1;x<y;x++)
              printf(" ");
     for(c=1;c<=m;c++)
      {
              printf("%d",c);
             }
    printf("\n");
           y--;
          }
}


Socializer Widget By Blogger Yard
SOCIALIZE IT →
FOLLOW US →
SHARE IT →