Question 9.
Write a program to input a string and convert it into uppercase and print the pair of
vowels and number of pair of vowels occurring in the string.
Example:
Input:
"BEAUTIFUL BEAUTIES "
Output :
Pair of vowels: EA, AU, EA, AU, IE
No. of pair of vowels: 5
Answers
Heya Mate here is ur answer...
Hope it helps ❤❤❤❤
Write a program to input a string and convert it into uppercase and print the pair of vowels and number of pair of vowels occurring in the string.
Explanation:
Function to check character is vowel or not:
public static boolean checkVowel(char ch) {
if (ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U') {
return true;
} else {
return false;
}
}
OUTPUT
Enter any string- beautiful beauties
Pair of vowels: EA
Pair of vowels: AU
Pair of vowels: EA
Pair of vowels: AU
Pair of vowels: IE
No. of pair of vowels: 5
Please find attached program in Java