Algorithm
Step 1 : Start
Step 2 : Read char
Step 3 : If char is either 'a', 'e', 'i', 'o' or 'u' then
Print "It's a vowel"
Step 3.1 : else
Print "It's a consonant"
Step 4 : Stop
Program (vowel.sh)
# Vowel with multiple values in a pattern
echo -n "Key in a lower case character : "
read choice
case $choice in
a|e|i|o|u) echo "It's a Vowel";;
*) echo "It's a Consonant"
esac
Output
[vijai@localhost multway]$ sh vowel.c
Key in a lower case character : e
It's a Vowel
Step 1 : Start
Step 2 : Read char
Step 3 : If char is either 'a', 'e', 'i', 'o' or 'u' then
Print "It's a vowel"
Step 3.1 : else
Print "It's a consonant"
Step 4 : Stop
Program (vowel.sh)
# Vowel with multiple values in a pattern
echo -n "Key in a lower case character : "
read choice
case $choice in
a|e|i|o|u) echo "It's a Vowel";;
*) echo "It's a Consonant"
esac
Output
[vijai@localhost multway]$ sh vowel.c
Key in a lower case character : e
It's a Vowel
No comments:
Post a Comment