filmov
tv
Check Whether a character is Vowel or Consonant || C++ Program
Показать описание
"Check Whether a character is Vowel or Consonant", C++ Program.
Source Code link :
In this example, if...else statement is used to check whether an alphabet entered by the user is a vowel or a constant.
To understand this example, you should have the knowledge of the following C++ programming topics :- C++ if, if...else and Nested if...else
Five alphabets a, e, i, o and u are known as vowels. All other alphabets except these 5 alphabets are known as consonants.
This program assumes that the user will always enter an alphabet.
The character entered by the user is stored in variable c.
The [ isLowerCaseVowel ]evaluates to [ true] if [ c ] is a lowercase vowel and [ false ] for any other character.
Similarly, [ isUpperCaseVowel ] evaluates to [ true ] if c is an uppercase vowel and [ false ] for any other character.
If both [ isLowercaseVowel ] and [ isUppercaseVowel ] is [ true] , the character entered is a vowel, if not the character is a consonant.
The [ isalpha() ] function checks whether the character entered is an alphabet or not. If it is not, it prints an error message.
CodeSays Website link :
All Source Codes are available here :
#COMPUTERPROGRAMMING :)
Source Code link :
In this example, if...else statement is used to check whether an alphabet entered by the user is a vowel or a constant.
To understand this example, you should have the knowledge of the following C++ programming topics :- C++ if, if...else and Nested if...else
Five alphabets a, e, i, o and u are known as vowels. All other alphabets except these 5 alphabets are known as consonants.
This program assumes that the user will always enter an alphabet.
The character entered by the user is stored in variable c.
The [ isLowerCaseVowel ]evaluates to [ true] if [ c ] is a lowercase vowel and [ false ] for any other character.
Similarly, [ isUpperCaseVowel ] evaluates to [ true ] if c is an uppercase vowel and [ false ] for any other character.
If both [ isLowercaseVowel ] and [ isUppercaseVowel ] is [ true] , the character entered is a vowel, if not the character is a consonant.
The [ isalpha() ] function checks whether the character entered is an alphabet or not. If it is not, it prints an error message.
CodeSays Website link :
All Source Codes are available here :
#COMPUTERPROGRAMMING :)