Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Midterm program 2 (Mark Hansen)
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- char symbol = '+'; //Define symbol variable
- for(int height=1;height<=7;height++)//Loop to keep track of height on the first shape
- {
- for(int row=1;row<=height*2-1;row++)//Nested loop to print symbols
- cout << symbol;
- cout << "\n";//Newline each row
- }
- cout << "\n\n";//Space between the two shapes
- for(int height=7;height>=1;height--)//Loop to keep track of height on the second shape
- {
- for(int row=1;row<=height*2-1;row++)//Nested loop to print symbols
- cout << symbol;
- cout << "\n";//Newline each row
- }
- system("PAUSE");
- return 0;
- }
Add Comment
Please, Sign In to add comment