title: Change background color of console output in C and C++
body: <p>I change the background and text color in my console by using the "system" command.</p>
  
  <pre><code>    #include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
  system ("color 1a");
  cout &lt;&lt;"Hello World";
  
  cin.ignore();
  return 0;
  }
  </code></pre>
  
  <p>Is there a way to change color in only one line? C or C++ are fine.
  Thanks.</p>