#include <stdio.h>
#include <string.h>

//**************************************************************
// Function: isLegal
// 
// Purpose: Determine if a given word is legal
// 
// Parameters:
// 
//     theString - string/word that determining if legal or not
//
// Returns: whether legal (1=legal, 0=not legal)
//  
//**************************************************************

int isLegal (char theString[]){
    char vowels[]={'a','e','i','o','u','y','A','E','I','O','U','Y'};

    int numVowels=0; //initializing the variable that will hold the number of vowels
    for (int i=0; theString[i]!='\0';i++){ //looping through the characters in the string being searched
        // for (int j=0; j<strlen(vowels);j++){
        //     if (theString[i]==vowels[j]){
        //         numVowels+=1;
        //     }
            numVowels+=1;
        }
    return numVowels;
}
int main() {
	int numVowels= isLegal("try");
    printf("Number of vowels: %i\n", numVowels); 
	return 0;
};

