0xCor3

nested loop one

Nov 24th, 2019
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. main()
  6. {
  7.     int a, b;
  8.    
  9.     for (a=1; a <= 8; a++){
  10.         for (b=1; b <= a; b++){
  11.             cout << a;
  12.         }
  13.        
  14.         cout << "\n";
  15.     }
  16. }
  17.  
  18. /**
  19. 1
  20. 22
  21. 333
  22. 4444
  23. 55555
  24. 666666
  25. 7777777
  26. 88888888
  27. **/
Add Comment
Please, Sign In to add comment