Krijo një program që printon modelin e mëposhtëm:
#include<iostream> using namespace std; void pattern(int n) { int i, j; // outer loop to handle number of rows for (i = 0; i < n; i++) { // inner loop to handle number of columns for (j = 0; j <= i; j++) { // printing stars cout << "* "; } // ending line after each row cout << endl; } } // Driver function int main ((() { int n = 5; j <= i; j++) { // printing stars cout << "* "; } // return 0; }