this program is supposed to create a box with a horizontal line of the limit that a user inputs from 2-9... for example a limit of 5 would create:
5$$$$
$5$$$
$$5$$
$$$5$
$$$$5
an input of 4 would create:
4$$$
$4$$
$$4$
$$$4
and so on... i cant seem to combine the parts together.... im pretty sure i need 3 for statements, one for the bottom $ part, one for the number and one for the upper $ part. this is what i have so far... they're 2 different files as i dont have a clue how to combine them
int main()
{
int limit = 5;
for (int row = 1; row < limit; row++)
{
for (int col = 0; col < row; col++)
cout << "$";
cout << endl;
}
system("pause");
return 0;
}
creates:
$
$$
$$$
$$$$
#include <iostream>
using namespace std;
int main()
{
int limit = 5;
for (int row = limit; row > 1; row--)
{
for (int jam = 1; jam < row; jam++)
cout << "$";
cout << endl;
}
system("pause");
return 0;
}
creates:
$$$$
$$$
$$
$
help plz :( i need to figure out how to combine them and put the limit as a horizontal line running through them.