Hello I am new. I need to write a program using at least one while loop to count and display the amount of vowels in a user input string. This is what I have so far.
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int acounter(0); // Create counters for each vowel
int ecounter(0);
int icounter(0);
int ocounter(0);
int ucounter(0);
char c; // Set variable c as a character
cout << "Input: "; // Let user declare c
cin >> c;
while (c) // Run loop to count vowels
{
if (c == 'a'|| c== 'A')
{
acounter = acounter + 1;
}
if (c == 'e'|| c== 'E')
{
ecounter = ecounter + 1;
}
if (c == 'i'|| c== 'I')
{
icounter = icounter + 1;
}
if (c == 'o'|| c== 'O')
{
ocounter = ocounter + 1;
}
if (c == 'u'|| c== 'U')
{
ucounter = ucounter + 1;
}