How would I fix something like this:
It is without the is a vowel or is not a vowel, still doesn't work but how do I fix it?

This is what it

Today Is Thr Jan, 2015
Enter a sentence:



#include <iostream> 
#include <iomanip> 
#include <string>

using namespace std;

int main()
{
    int Uc = 0, Dc = 0, Vc=0;
    int i=0;
    char c = getchar();
    string vowels("aeiouAEIOU");

    cout << "Enter a sentence: ";
    cin.get(c);  

      while (c != '\n')
     {
        if (c >= 'A' && c <= 'Z') {
         Uc++;
          i++;
        }           
        else if(c >= '0' && c <= '9') {     
            Dc++;
             i++;
        }

        else if(vowels.find(c) != string::npos)
        {
        Vc++; 
        i++; 
        }
      }

      cout << setfill ('.');
      cout << "Number of uppercase letters" << right << setw(10) << Uc << endl; 
      cout << "Number of digits" << right << setw(10) << Dc << endl;  
      cout << "Number of vowels" << right << setw(10) << Vc << endl;  

    //end program
    system("pause");
    return 0;
}

I cleaned it up a little but how come it enters again? And how do I clean up the vowels?

#include <iostream> 
#include <iomanip> 
#include <string>

using namespace std;

int main()
{
    char c;
    int Uc = 0, Dc=0;

    cout << "Enter a sentence: ";
    cin.get(c);
    while(c != '\n')
    {
        if(isupper(c))  
            Uc++;  
        cin.get(c);
        {
         if(isdigit(c)) 
            Dc++; // 
        cin.get(c);
        }
    }
     cout << setfill ('.');
     cout << "Number of uppercase letters" << right << setw(10) << Uc << endl; 
     cout << "Number of digits" << right << setw(10) << Dc << endl; 

     system("pause");
    return 0;
}

This is what I wrote but doesn't get the correct output

#include <iostream> 
#include <iomanip> 
#include <string>

using namespace std;

int main()
{
    char c;
    int Uc = 0, Dc=0, Vc=0;
    string vowels("aeiouAEIOU");

    cout << "Enter a sentence: ";
    cin.get(c);
    while(c != '\n')
    {
        if(isupper(c))  
            Uc++;  
        cin.get(c);
        {
        if(isdigit(c)) 
            Dc++; // 
        cin.get(c);
        }
        {
        if(vowels.find(c) != string::npos)
            Vc++;
        cin.get(c);
        }
    }
     cout << setfill ('.');
     cout << "  Number of uppercase letters" << right << setw(10) << Uc << endl; 
     cout << "  Number of digits" << right << setw(20) << Dc << endl; 
     cout << "  Number of vowels" << right << setw(20) << Vc << endl;

     system("pause");
    return 0;
}

This is the output:

Enter a sentence: Today Is Thr Jan, 2015


  Number of uppercase letters.........3
  Number of digits...................1
  Number of vowels...................1
Press any key to continue . . .

The output should look like this:

Enter a sentence: Today Is Thr Jan, 2015
  Number of uppercase letters.........4
  Number of digits....................4
  Number of vowels....................4
Press any key to continue . . .
This article has been dead for over six months. Start a new discussion instead.