Answers for "print a vowel in a string skillrack"

0

print a vowel in a string skillrack

#include <stdio.h>
#include <stdlib.h>

int isVowel(char ch)
{
    ch = tolower(ch);
    return ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u';
}

int main()
{
    char str[100];
    scanf("%[^\n\r]", str);
    for(int index = 0; str[index]; index++)
    {
        if(isVowel(str[index]))
        {
            printf("%c", str[index]);
        }
    }
}
Posted by: Guest on September-17-2021

Code answers related to "print a vowel in a string skillrack"

Browse Popular Code Answers by Language