
Ralph W. answered 06/06/21
C programming from Basic to the Advanced, Learn from me!
This answer was written in C++ and can be converted to C by some simple changes.
//============================================================================
// Name : HelloWorldDemo.cpp
// Author : R Tutor
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
int main() {
// declare variables
string string1;
int count = 0;
// Getting the user input string and evaluates the string one character at a time. While it
// loops through the string it looked for the (a,e,I,o,u) and increases the count value by one.
cout << "Enter in string" << endl;
cin >> string1;
for(int i = 0; i < string1.length();i++)
{
char ch = string1[i];
if (ch == 0x61 || ch == 0x65 || ch == 0x69 || ch == 0x6F || ch == 0x75 )
{
count++;
}
}
cout << "Total Count: " << count << endl;
return 0;
}