Java Program to Check Whether an Alphabet is Vowel or Consonant
mrt481 4K 28th Aug, 2022
Loading Please wait...
Description
In the above program, 'i' is stored in a char variable ch. In Java, you use double quotes (" ") for strings and single quotes (' ') for characters. Now, to check whether ch is vowel or not, we check if ch is any of: ('a', 'e', 'i', 'o', 'u'). This is done using a simple if..else statement. We can also check for vowel or consonant using a switch statement in Java.
Recent Pastes
- C++ Program to Add Two Numbers
C++ | 5.6K | 11 months ago
- C++ Program to Print Number Entered by User
C++ | 3.3K | 11 months ago
- C++ "Hello, World!" Program
C++ | 2.4K | 11 months ago
Please disable your adblock and script blockers to view this page