title: how can i count how many consonants are in a string so far i have this
body: <pre><code>int countConsonant(string str, int consonant)
  {
      int length = str.length();
       consonant = 0;
  
          for (int i = 0; i &lt; length; i++)
          {
              if(str[i] == 'b'&amp;&amp; str[i] == 'c' &amp;&amp; str[i] == 'd'&amp;&amp; str[i] == 'f'
                  &amp;&amp; str[i] == 'g'&amp;&amp; str[i] == 'h'&amp;&amp; str[i] == 'j' &amp;&amp; str[i] == 'k'&amp;&amp; str[i] == 'l'&amp;&amp; str[i] == 'm'
                  &amp;&amp; str[i] == 'n'&amp;&amp; str[i] == 'p'&amp;&amp; str[i] == 'q'&amp;&amp; str[i] == 'r'&amp;&amp; str[i] == 's'&amp;&amp; str[i] == 't'
                  &amp;&amp; str[i] == 'v'&amp;&amp; str[i] == 'w'&amp;&amp; str[i] == 'x'&amp;&amp; str[i] == 'y'&amp;&amp; str[i] == 'z')
  
                  consonant = consonant + 1;
          }
          return consonant;
  }
  </code></pre>