This program prints the outline of a rectangle with 6 asterisks
across and 8 asterisks down.
Input: None
Output: Prints the outline of the rectangle.
It is suppose to print a rectangle.
Something like this, but I just keep getting the lines on the top.
******
*
*
*
*
*
******
across and 8 asterisks down.
Input: None
Output: Prints the outline of the rectangle.
Code:
#include <iostream> #include <string> using namespace std; int main() { const int NUM_ACROSS = 6; const int NUM_DOWN = 8; int row; int column; for (row = 0; row <= NUM_ACROSS; row++) for (column = 0; column <= NUM_DOWN; column++) if (row == 0 || NUM_ACROSS == 6) cout << "*"; else if (column == 0 || NUM_DOWN == 8) cout << "*"; else cout << " "; cout << endl; return 0; } // End of main()
Something like this, but I just keep getting the lines on the top.
******
*
*
*
*
*
******
Comment