Advertisement
JUN7

nested loop two

Nov 24th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. main()
  6. {
  7.     int a, b;
  8.  
  9. cout<<"               ________________________________ "<<endl;
  10. cout<<"              |                                |  "<<endl;
  11. cout<<"              |         NESTED LOOP TWO        | "<<endl;
  12. cout<<"              |________________________________| "<<endl;
  13. cout<<"         "<<endl;
  14.  
  15.     for (a=1; a <= 8; a++){
  16.         for (b=a; b <= 8; b++){
  17.             cout << a;
  18.         }
  19.        
  20.         cout << "\n";
  21.     }
  22. }
  23.  
  24. /**
  25. 11111111
  26. 2222222
  27. 333333
  28. 44444
  29. 5555
  30. 666
  31. 77
  32. 8
  33. **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement