title: Changing a lowercase character to uppercase in c++
body: <p>Here is the code that i wrote. When i enter a lowercase character such as 'a', it gives me a blank character but afterwards it works well. Can you tell me what i did wrong? Thanks. :)</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  int main()
  {
      char letter;
  
      cout &lt;&lt; "You will be asked to enter a character.";
      cout &lt;&lt; "\nIf it is a lowercase character, it will be converted to uppercase.";
      cout &lt;&lt; "\n\nEnter a character. Press . to stop: ";
  
      cin &gt;&gt; letter;
  
      if(islower(letter))
      {
          letter = isupper(letter);
          cout &lt;&lt; letter;
      }
  
      while(letter != '.')
      {
          cout &lt;&lt; "\n\nEnter a character. Press . to stop: ";
          cin &gt;&gt; letter;
  
          if(islower(letter))
          {
              letter = toupper(letter);
              cout &lt;&lt; letter;
          }
      }
  
      return 0;
  }
  </code></pre>