Displaying "C++" in ASCII art with user inputting an integer
Graphical representation

From your 'number &lt;&lt; number &lt;&lt; number' thing it is not immediately obvious what is being drawn, and how to fix it in a specific way when needed.

By using the template where you just replace placeholder characters with what you need, you get more WYSIWYG-like result.

Input validation

Your code assumes that user inputs appropriate value. What if user inputs 1234? (You can get more fancy and guard against inputting non-numbers too)

#include &lt;iostream&gt;

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::to_string;

const auto ASCII_template = string("\
SSSSSSSSSSS\n\
SSS               SS           SS\n\
SSS               SS           SS\n\
SSS           SSSSSSSSSS   SSSSSSSSSS\n\
SSS               SS           SS\n\
SSS               SS           SS\n\
SSSSSSSSSSS");


string replace_all(const string&amp; base_string, const string&amp; search, const string&amp; replace) {
  string s = string(base_string);
  size_t pos = s.find(search);
  size_t len = replace.size();
  while ( pos != string::npos ) {
     s.replace( pos, len, replace );
     pos = s.find(search);
  }
  return s;
}

unsigned int get_user_digit() {
  unsigned int result;
  do {
    cout &lt;&lt; "Please enter a single digit:" &lt;&lt; endl;
    cin &gt;&gt; result;
  } while (result &gt;= 10);
  return result;
}

int main() {
  cout &lt;&lt; replace_all(ASCII_template, string("S"), to_string(get_user_digit())) &lt;&lt; endl;
  return 0;
}


You can try it online here.

I don't remember C++ that much, but something along those lines would work. Depending on how much of С++11 you can use, std::regex_replace would simplify replace_all function. If you can not use std::string, it wouldn't change that much either, although you'd have to use some C-like workaround.