Guest User

Untitled

a guest
Jan 21st, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. //Midterm program 2 (Mark Hansen)
  2. #include <iostream>
  3. #include <cstdlib>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. char symbol = '+'; //Define symbol variable
  9.  
  10. for(int height=1;height<=7;height++)//Loop to keep track of height on the first shape
  11. {
  12. for(int row=1;row<=height*2-1;row++)//Nested loop to print symbols
  13. cout << symbol;
  14. cout << "\n";//Newline each row
  15. }
  16. cout << "\n\n";//Space between the two shapes
  17. for(int height=7;height>=1;height--)//Loop to keep track of height on the second shape
  18. {
  19. for(int row=1;row<=height*2-1;row++)//Nested loop to print symbols
  20. cout << symbol;
  21. cout << "\n";//Newline each row
  22. }
  23. system("PAUSE");
  24. return 0;
  25. }
Add Comment
Please, Sign In to add comment