fork download
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. int n;
  8. cout << "Please enter a number between 1 and 10:" << endl;
  9. cin >> n;
  10.  
  11.  
  12. for (int x = 0; x <= n; ++x) {
  13. for (int y = 0; y < x; ++y) {
  14. cout << "*" ;
  15. }
  16. std::cout << "\n";
  17. }
  18.  
  19. return 0;
  20. }
  21.  
  22.  
  23.  
Success #stdin #stdout 0s 3472KB
stdin
10
stdout
Please enter a number between 1 and 10:

*
**
***
****
*****
******
*******
********
*********
**********