fork download
  1. //@Author Damien Bell
  2. #include <iostream>
  3. #include <cmath>
  4. using namespace std;
  5. int main(){
  6. int choice=0, i, j;
  7.  
  8. cout << "How many digits do you want to use: ";
  9. cin >> choice;
  10.  
  11. //One set of loops to count up to 5
  12.  
  13. for(i=1; i<=choice; i++){//outer loop
  14.  
  15. for(j=1; j<=i; j++){//inner loop
  16.  
  17. cout << j; //Cout present counter for J
  18.  
  19. }//end inner loop
  20.  
  21. cout << endl; // Line break
  22.  
  23. }//end outer loop
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0s 2728KB
stdin
5
stdout
How many digits do you want to use: 1
12
123
1234
12345