Print Function

Hello. I'm trying to use a Print function to make a box of "$" based on a number from a cin <<. For example: after a prompt, the user inputs the number 6.
The box should be 6 wide, and 6/2 down, with 4 blank spaces in the middle row

$$$$$$
$\b\b\b\b$
$$$$$$

Where above I wrote \b the program output should be blank space
I can't figure out how to print "$" however many times the user inputs other than using a counter. I also can't figure out how to print the other lines that use blank space also.

I appreciate any help.
Last edited on
You can print a temporary string (per line)
eg:
 
std::cout << std::string ( 6, '$' ) << '\n';
$$$$$$
Topic archived. No new replies allowed.