# Program to Print Pattern 12

Program to Print Pattern 12 on fibonacci, factorial, prime, armstrong, swap, reverse, search, sort, stack, queue, array, linkedlist, tree, graph, pattern, string etc.

## Program to print the following pattern

### Algorithm

1. Start
2. Let i be an integer number.
3. Let j be an integer number.
4. Repeat step 5 to 8 until all value parsed.
5. Set i = 0 and check i<10;
6. Set j = 0 and check j <= 10;
7. Check conditions if(i==0 or i==10 or j==0 or j==10)
8. If true print ?1? else print space.
9. End

### JAVA

```import java.util.Scanner;
public class PatternBox
{
public static void main(String[] args) {
for (int i = 1; i <= 10; i++)
{
for (int j = 1; j <= 10; j++)
{
if (i==1 || i==10 || j==1 || j==10 )
System.out.print(" 1");
else
System.out.print("  ");
}
System.out.println();
}
}}
```

### Python

```def box(r, c) :

for i in range(1, r+1) :
for j in range(1, c+1) :
if (i == 1 or i == r or
j == 1 or j == c) :
print("1"),
else :
print(" "),

print(" ")
rows = 6
columns = 10
box(rows, columns)
```

### C program

```#include <stdio.h>
int main()
{
for (int i = 1; i <= 10; i++)
{
for (int j = 1; j <= 10; j++)
{
if (i==1 || i==10 || j==1 || j==10 )
printf(" 1");
else
printf("  ");

}
printf("\n");
}
}
```

### C# program

```using System;
public class Program
{
public static void Main()
{
int row, i, j;
row = 5;
for (i = 0; i <= 10; i++)
{
for (j = 0; j <= 10 ; j++)
{
if (i == 0 || i == 10 || j == 0 || j== 10)
Console.Write("1");
else
Console.Write(" ");
}
Console.WriteLine();
}
}
}
```

### PHP program

```        for (\$i = 1; \$i <= 10; \$i++)
{
for (\$j = 1; \$j <= 10; \$j++)
{
if (\$i==1 || \$i==10 || \$j==1 || \$j==10 )
{

echo "1";
}
else
{
echo " ";
}
}
echo "<br>";
}
```