-moz-user-select:none; -webkit-user-select:none; -khtml-user-select:none; -ms-user-select:none; user-select:none;

Saturday 11 April 2015

Determining a vowel using "switch" statement

Hello and Asalam o Alikum. I hope you all are fine by the grace of Allah Almighty.
Today I am here with a new program that will determine a vowel using “switch” statement.We know that vowel characters are:"a,e,i,o,u".
As I have discussed in my previous blog that a “switch” statement is used to test different conditions. So, in the below mentioned program, I will take a character from the user and it will determine whether it is vowel or not.
Suppose I enter “E” as input. As we know that “E” is a vowel, so it will compare it with different cases. If it matches with a certain case, it will display “You entered a vowel.” If it does not matches with any of the case, the statement(s) below the default case will be executed and it will display, “You entered a consonant.”

Below is the source code of this program.

Source code


Output

If you have any ambiguity in understanding the logic of this program, feel free to contact me at "G.A.Mujtaba11@gmail.com".


No comments:

Post a Comment