⓲C Program to Print Right Star Triangle
Program: Right Star Triangle #include <stdio.h> int main () { int i , j ; // Outer loop controls the number of rows for ( i = 1 ; i <= 5 ; i ++ ) { // Inner loop prints stars in each row for ( j = 1 ; j <= i ; j ++ ) { printf ( "* " ); } // Move to next line after each row printf ( "\n" ); } return 0 ; } Output * * * * * * * * * * * * * * * Explanation 1️⃣ Header File #include <stdio.h> This line allows us to use printf() for printing output. 2️⃣ Main Function int main () The program execution starts from the main() function . 3️⃣ Variable Declaration int i , j ; i → controls rows j → controls number of stars in each row 4️⃣ Outer Loop (Rows) for ( i = 1 ; i <= 5 ; i ++ ) This loop decides how many rows will print . i value Row 1 Row 1 2 Row 2 3 Row 3 4 Row 4 5 Row 5 5️⃣ Inner Loop (Stars) for ( j = 1 ; j ...