DevJourney · code I wrote while learning
main.cpp
171 Bvoid nTriangle(int n) {
for (int i = 0; i < n; ++i) {
for (int j = 0; j <= i; ++j) {
cout << j + 1 << ' ';
}
cout << '\n';
}
}DevJourney · code I wrote while learning
void nTriangle(int n) {
for (int i = 0; i < n; ++i) {
for (int j = 0; j <= i; ++j) {
cout << j + 1 << ' ';
}
cout << '\n';
}
}