Advertisement
JUN7

nested loop theere

Nov 24th, 2019
284
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 THEERE       | "<<endl;
  12. cout<<"              |________________________________| "<<endl;
  13. cout<<"         "<<endl;
  14.  
  15.     for (a=7; a >= 1; a--){
  16.         for (b=a; b >= 1; b--){
  17.             cout << (a-b) + 1;
  18.         }
  19.        
  20.         cout << "\n";
  21.     }
  22. }
  23.  
  24. /**
  25. 1234567
  26. 123456
  27. 12345
  28. 1234
  29. 123
  30. 12
  31. 1
  32. **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement