Make a C++ program using do while loops that will print this output:
*
**
***
****
*****
#include <iostream>
using namespace std;
int main() {
for (int i = 1; i <= 5; i++) {
for (int j = 0; j < i; j++) {
cout << "*";
}
cout << "\n";
}
return 0;
}
Comments
Leave a comment