title: Switch Statement C++ - error C2046: illegal case, error C2043: illegal break
body: <pre><code>#include &lt;iostream&gt; 
  #include &lt;string&gt; 
  
  using namespace std;
  
  //void multiply(int b);
  
  int main()
  { 
   float total = 0;
   float b = 0;
   cout &lt;&lt; "Enter number: " &lt;&lt; endl;
   cin &gt;&gt; b;
  
  
   char TorD;
   cout &lt;&lt; "Would you like to times (*), divide (/), add (+) or minus (-) this number?" &lt;&lt; endl;
   cin &gt;&gt; TorD;
  
   switch (TorD)
  
    case '*' : 
   {
    int c=0;
    cout &lt;&lt; "by how many?" &lt;&lt; endl;
    cin &gt;&gt; c;
    total = b * c;
    cout &lt;&lt; b &lt;&lt; " * " &lt;&lt; c &lt;&lt; " = " &lt;&lt; total &lt;&lt; endl;
  
   }
   break;
    case '/' :
     {
      int c=0;
      cout &lt;&lt; "by how many?" &lt;&lt; endl;
      cin &gt;&gt; c;
      total = b / c;
      cout &lt;&lt; b &lt;&lt; " / " &lt;&lt; c &lt;&lt; " = " &lt;&lt; total &lt;&lt; endl;
  
     }
     break;
  
    case '+' :
     {
      int c=0;
      cout &lt;&lt; "by how many?" &lt;&lt; endl;
      cin &gt;&gt; c;
      total = b + c;
      cout &lt;&lt; b &lt;&lt; " + " &lt;&lt; c &lt;&lt; " = " &lt;&lt; total &lt;&lt; endl;
  
     }
     break;
  
    case '-' :
     {
      int c=0;
      cout &lt;&lt; "by how many?" &lt;&lt; endl;
      cin &gt;&gt; c;
      total = b - c;
      cout &lt;&lt; b &lt;&lt; " - " &lt;&lt; c &lt;&lt; " = " &lt;&lt; total &lt;&lt; endl;
  
     }
     break;
  
    default:
  
     cout &lt;&lt; "You did not correctly enter /, *, +, or - !!" &lt;&lt; endl;
  
     //multiply(b);
  
     system("pause"); 
     return 0;
  
  }
  </code></pre>