The output comes out wrong it should be different:
//This is what I have
Enter a sentence: Today Is Thr Jan, 2015
Number of uppercase letters.........2
Number of digits....................2
Number of vowels....................2
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 . . .
#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++;
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(22) << Dc << endl;
cout << " Number of vowels" << right << setw(22) << Vc << endl;
system("pause");
return 0;
}