practice problems for nested loops in c++

#include <iostream>

int main() {
    // Problem 1: Print a rectangle of stars
    for (int i = 0; i < 5; ++i) {
        for (int j = 0; j < 10; ++j) {
            std::cout << "* ";
        }
        std::cout << std::endl;
    }

    // Problem 2: Print a right-angled triangle of numbers
    for (int i = 1; i <= 5; ++i) {
        for (int j = 1; j <= i; ++j) {
            std::cout << j << " ";
        }
        std::cout << std::endl;
    }

    // Problem 3: Print an inverted right-angled triangle of alphabets
    for (char ch = 'E'; ch >= 'A'; --ch) {
        for (char innerCh = 'A'; innerCh <= ch; ++innerCh) {
            std::cout << innerCh << " ";
        }
        std::cout << std::endl;
    }

    // Problem 4: Print a hollow square of hashes
    for (int i = 1; i <= 5; ++i) {
        for (int j = 1; j <= 5; ++j) {
            if (i == 1 || i == 5 || j == 1 || j == 5) {
                std::cout << "# ";
            } else {
                std::cout << "  ";
            }
        }
        std::cout << std::endl;
    }

    return 0;
}