About Lesson
Print a Pattern of Stars using Nested For Loops.
#include <stdio.h>
int main() {
int rows;// Taking input for the number of rows
printf(“Enter the number of rows: “);
scanf(“%d”, &rows);// Printing a pattern of stars using nested for loops
for (int i = 1; i <= rows; i++) {
for (int j = 1; j <= i; j++) {
printf(“* “);
}
printf(“n”);
}return 0;
}