title: Making a Boolean trying to print out uppercase letters
body: <p>The objective is to make it so that all uppercase letters are printed out in a string, however, I must keep the bool function and use it within my code. I have resolved some issues from the past but ran up with a issue that is preventing me from fixing it. Test cases are &quot;HEllO&quot; -&gt; &quot;HEO&quot; &quot;my&quot; -&gt; &quot;&quot; &quot;NAME&quot; -&gt; &quot;NAME&quot; &quot;Is&quot; -&gt; &quot;I&quot; &quot;AnDeRsON&quot; -&gt; &quot;ADRON&quot;.</p>
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
    bool isUpperCase(char ch){
      if(ch &gt;= 'A' and ch &lt;= 'Z'){
        return true;
          }
          return false;
          }
  
  int main() {
  
    string a = &quot;&quot;;
    cin &gt;&gt; a;
    string c = &quot;&quot;;
    
    for(int i = 0; i &lt; a.length(); i++)
      {
        if (isUpperCase(a[i])) i++;
          {
            c += a[i];
          }
  
      }
    cout &lt;&lt; c &lt;&lt; endl;
  }
  </code></pre>
  <p>Now whenever I do a case like &quot;CHADnigeria&quot; it turns it into &quot;HDnigeria&quot; even though I want it to say &quot;CHAD&quot;. It also removes the capitals which I do not want and it should be removing the lowercases. &quot;DancingInTheSky&quot; turns into &quot;ancingnheky&quot; which should be &quot;DITS&quot;. Reminder that the bool function must not be changed though.</p>