#include <stdio.h>
int main() {
int rows;
printf("Enter the number of rows for the half pyramid: ");
scanf("%d", &rows);
if (rows <= 0) {
printf("Please enter a positive number of rows.\n");
} else {
for (int i = 1; i <= rows; i++) {
for (int j = 1; j <= i; j++) {
printf("%d ", j);
}
printf("\n");
}
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: