answersLogoWhite

0

// short version

char c = 'a';

System.out.println((c=='a'c=='e'c=='i'c=='o'c=='u')?"VOWEL":"CONSONANT");

// easy to read version

char c = 'a';

switch (c) {

case 'a':

case 'e':

case 'i':

case 'o':

case 'u':

System.out.println("VOWEL");

break;

default:

System.out.println("CONSONANT");

}

User Avatar

Wiki User

16y ago

What else can I help you with?

Continue Learning about Engineering

Write a program that stores vowels in an array When you program is given a character it should indicate whether the character is vowel or not?

That's easy to do!This script will get the POST data from an HTML form and check if it is a vowel.


Write a program in foxpro to chek inputed character is vowel or not?

You can use the following FoxPro code snippet to check if an input character is a vowel: CLEAR INPUTCHAR = UPPER(INPUT("Enter a character: ")) IF INLIST(INPUTCHAR, "A", "E", "I", "O", "U") ? "The character is a vowel." ELSE ? "The character is not a vowel." ENDIF This program prompts the user for a character, converts it to uppercase, and checks if it is one of the vowels using the INLIST function.


What is the C program to check whether a given character is vowel or not using switch case?

#includemain(){char ch;clrscr();pritnf("\nEnter any character:");fflush(stdin);scanf("%c",&ch);if (ch 'U' ch = 'u'){printf("\n The entered character %c is Vowel.\n", ch);}else{printf("\nThe entered character %c is not Vowel.\n",ch);}}


A c plus plus program that defines vowels?

#include<locale> #include<iostream> #include<string> bool is_vowel(const char c) { static const std::string vowels = "AEIOU"; return( vowels.find(toupper(c))<vowels.size() ); } int main() { std::string alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; for(size_t i=0; i<alphabet.size(); ++i) { std::cout<<'\''<<alphabet[i]<<"\' is "; if( !is_vowel( alphabet[i] )) std::cout<<"not "; std::cout<<"a vowel."<<std::endl; } } Output: 'a' is a vowel. 'b' is not a vowel. 'c' is not a vowel. 'd' is not a vowel. 'e' is a vowel. 'f' is not a vowel. 'g' is not a vowel. 'h' is not a vowel. 'i' is a vowel. 'j' is not a vowel. 'k' is not a vowel. 'l' is not a vowel. 'm' is not a vowel. 'n' is not a vowel. 'o' is a vowel. 'p' is not a vowel. 'q' is not a vowel. 'r' is not a vowel. 's' is not a vowel. 't' is not a vowel. 'u' is a vowel. 'v' is not a vowel. 'w' is not a vowel. 'x' is not a vowel. 'y' is not a vowel. 'z' is not a vowel. 'A' is a vowel. 'B' is not a vowel. 'C' is not a vowel. 'D' is not a vowel. 'E' is a vowel. 'F' is not a vowel. 'G' is not a vowel. 'H' is not a vowel. 'I' is a vowel. 'J' is not a vowel. 'K' is not a vowel. 'L' is not a vowel. 'M' is not a vowel. 'N' is not a vowel. 'O' is a vowel. 'P' is not a vowel. 'Q' is not a vowel. 'R' is not a vowel. 'S' is not a vowel. 'T' is not a vowel. 'U' is a vowel. 'V' is not a vowel. 'W' is not a vowel. 'X' is not a vowel. 'Y' is not a vowel. 'Z' is not a vowel.


When should a switch statement be used?

switch is a loop which is used for checking various conditions and print corresponding matter.switch(a)//where a is that whose condition you have to check.#includemain(){char a;printf("enter a char.");scanf("%c",&a);switch(a){case 'a':printf("vowel");break;case 'e':printf("vowel");break;case 'i':printf("vowel");break;case 'o':printf("vowel");break;case 'u':printf("vowel");break;default:printf("consonent");}}

Related Questions

Write a program to print whether the letter is vowel or not in BASIC?

vowels$ = "aeiou" CLS PRINT "PROGRAM: Find if letter is a vowel or not" PRINT INPUT "Type a single alphabet letter: (a-z)/and, then, press Enter key"; aLetter$ PRINT PRINT "Letter "; aLetter$; IF INSTR(vowels$, LCASE$(aLetter$)) THEN PRINT " is a vowel." ELSE PRINT " is NOT a vowel." END


How do you write algo for switch case?

input (alphabets) output(vowel or not vowel) operator(a,e,i,o,u) switch(alphabets) { case 'a' print"vowel" case'b' print"not vowel" case'e' print"vowel" case 'i' print"vowel" case 'o' print"vowel" case'u' print"vowel"


How you would you write a program in turbo c7 if letter is vowel or consonant?

You can write a program in Turbo C7 that takes a character as input and checks whether it is a vowel or a consonant by using a simple if-else statement. You can compare the input character with a list of vowels (a, e, i, o, u) and if it matches any of these, then it's a vowel; otherwise, it's a consonant. Print the result accordingly.


Write a program that stores vowels in an array When you program is given a character it should indicate whether the character is vowel or not?

That's easy to do!This script will get the POST data from an HTML form and check if it is a vowel.


Write a program in foxpro to chek inputed character is vowel or not?

You can use the following FoxPro code snippet to check if an input character is a vowel: CLEAR INPUTCHAR = UPPER(INPUT("Enter a character: ")) IF INLIST(INPUTCHAR, "A", "E", "I", "O", "U") ? "The character is a vowel." ELSE ? "The character is not a vowel." ENDIF This program prompts the user for a character, converts it to uppercase, and checks if it is one of the vowels using the INLIST function.


Write a program to adentify whether a character entered by a user is a vowel or a consonant?

You can check the value of a character by using if statements.Also, note that this code does not check for capital letters./* code */#include int main(){char c;c = getc(stdin);if (c 'o') {/* If the character is a vowel, this code will be executed. */} else if (c >= 'a' && c


How can you check vowel or consonent in vbnet?

You can check if a character is a vowel or a consonant in VB.NET by using a conditional statement with the Char.ToLower() method to ensure case insensitivity. You can then check if the character is a vowel by comparing it to a list of vowels using the Contains() method, and if it is not a vowel, it is considered a consonant.


What does boin mean in Japanese?

Boin can either mean 'Thumb print' or 'Vowel'


How is reading related to long vowel worksheets?

You don't have to make the long vowel worksheets if you go to vowel reading dot com. They have ready made worksheets for you to download, save and print for everyone.


Is the word new a short or long vowel word?

The vowel in new is long, whether it is pronounced noo or nyoo.


What is the symbol that denotes the vowel sound called?

The symbol that denotes the vowel sound is called a vowel symbol or a vowel character. It is used to represent specific vowel sounds in phonetic transcription or in the International Phonetic Alphabet (IPA).


Where can long vowel worksheets be gotten?

Kidslearningstation has all kinds of worksheets that you can print and use, including long vowel forms. Funfonix is another site that lets you get these same type of worksheets.