Here's a C program to print a rectangle pattern of numbers:
#include <stdio.h>
int main() {
int rows, cols;
printf("Enter the number of rows: ");
scanf("%d", &rows);
printf("Enter the number of columns: ");
scanf("%d", &cols);
for (int i = 1; i <= rows; i++) {
for (int j = 1; j <= cols; j++) {
printf("%2d ", i * j);
}
printf("\n");
}
return 0;
}
This program will create a rectangular pattern of numbers where each cell contains the product of the row and column numbers.
For example, if you input 3 for the number of rows and 4 for the number of columns, the program will generate the following pattern:
1 2 3 4
2 4 6 8
3 6 9 12
You can adjust the number of rows and columns by changing the values you enter when prompted.