Check whether an alphabet is vowel or consonant using switch statement - safetxt
avatar
Check whether an alphabet is vowel or consonant using switch statement

mrt481 7.5K 28th Aug, 2022

Java 0.44 KB
Loading Please wait...
Description

In the above program, instead of using a long if condition, we replace it with a switch case statement. If ch is either of cases: ('a', 'e', 'i', 'o', 'u'), vowel is printed. Else, default case is executed and consonant is printed on the screen.


Recent Pastes

Please disable your adblock and script blockers to view this page