Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to judge vowels and consonants in C language

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

The editor of this article introduces in detail "how to judge vowels and consonants in C language". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to judge vowels and consonants in C language" can help you solve your doubts. Let's follow the editor's train of thought to learn new knowledge.

Determine whether the letter entered is a vowel or a consonant.

English has 26 letters, and the vowels include only five letters: a, e, I, o and u, and the rest are consonants. Y is a semi-vowel and semi-consonant, but it is used as a consonant in English.

Example

# include

Int main () {

Char c

Int isLowercaseVowel, isUppercaseVowel

Printf ("enter a letter:")

Scanf (& c)

/ / lowercase vowels

IsLowercaseVowel = (c = ='a' | | c = ='e' | | c = ='i' | | c = ='o' | | c = ='u')

/ / uppercase vowel

IsUppercaseVowel = (c = ='A' | | c = ='E' | | c = ='I' | | c = ='O' | | c = ='U')

/ / if statement judgment

If (isLowercaseVowel | | isUppercaseVowel)

Printf ("% c is a vowel", c)

Else

Printf ("% c is consonant", c)

Return 0

}

Running result:

Enter a letter: GG is a consonant read here, this article "C language how to judge vowels and consonants" article has been introduced, want to master the knowledge of this article also need to practice and use in order to understand, if you want to know more related articles, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report