Here's a simple C program to print a star pattern:
#include <stdio.h>
int main() {
int rows;
printf("Enter the number of rows: ");
scanf("%d", &rows);
for (int i = 1; i <= rows; i++) {
for (int j = 1; j <= i; j++) {
printf("* ");
}
printf("\n");
}
return 0;
}
This program will print a star pattern with the number of rows you specify. Each row will have an increasing number of asterisks.
For example, if you input 4 for the number of rows, the program will generate the following star pattern:
*
* *
* * *
* * * *
You can adjust the number of rows by changing the value you enter when prompted.