Here's a C program to print a square pattern of numbers:
#include <stdio.h>
int main() {
int n;
printf("Enter the size of the square: ");
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
printf("%2d ", i);
}
printf("\n");
}
return 0;
}
This program will create a square pattern of numbers where each row contains the same number, and the number increases with each row.
For example, if you input 4 for the size of the square, the program will generate the following pattern:
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
You can adjust the size of the square by changing the value you enter when prompted.