How does a C program to check vowel or consonant work?

 Courtesy: Programiz.com


The character entered by the user is stored in variable c.

The lowercase_vowel variable evaluates to 1 (true) if c is a lowercase vowel and 0 (false) for any other characters.

Similarly, the uppercase_vowel variable evaluates to 1 (true) if c is an uppercase vowel and 0 (false) for any other character.

If either lowercase_vowel or uppercase_vowel variable is 1 (true), the entered character is a vowel. However, if both lowercase_vowel and uppercase_vowel variables are 0, the entered character is a consonant.

Comments

Popular posts from this blog

C program to read and display book information using structure

Function prototype and definition

Actual and Formal Parameters