### Program 333: Number Diamond Pattern 2 for given pattern

Program 333: Number Diamond Pattern 2 for given pattern
Method I:
```//    11
//   1221
//  123321
// 12344321
//1234554321
// 12344321
//  123321
//   1221
//    11
#include<stdio.h>
main()
{
int i,j,k,count,number;
printf("Enter number of rows\n");
scanf("%d",&number);
count=number-1;
for(i=1;i<=number;i++)
{
for(k=1;k<=count;k++)
{
printf(" ");
}
count--;
for(j=1;j<=i;j++)
{
printf("%d",j);
}
for(j=i;j>=1;j--){
printf("%d",j);
}
printf("\n");
}
count=1;
for(i=number-1;i>=1;i--)
{
if(i!=(2*(number)-1))
{
for(k=1;k<=count;k++)
{
printf(" ");
}
count++;
for(j=1;j<=i;j++)
{
printf("%d",j);
}
for(j=i;j>=1;j--){
printf("%d",j);
}
printf("\n");
}
}
}```

Method II:
```#include<stdio.h>
main()
{
int i,j,rows,k,space,num=1;
printf("Enter number of rows\n");
scanf("%d",&rows);
space=rows-1;
for(i=1;i<=2*rows-1;i++)
{
for(j=1;j<=space;j++)
printf(" ");
for(k=1;k<=num;k++)
printf("%d",k);
for(k=num;k>=1;k--)
printf("%d",k);
if(i<=rows-1)
{
num++;
space--;
}
else
{
space++;
num--;
}
printf("\n");
}
}```

Explanation:

//Coming Soon...

Output:

 Donate Buy me a coffee \$2.00 USD Buy me a burger \$5.00 USD Buy me a pizza \$10.00 USD
 Compiler Used by me C-Free 5.0(Recommended) Other Compilers Code Blocks(Recommended) Online Compilers Ideone(Remember to give input before executing online where ever necessary)