Tech Study

C# Program To Check Entered Character Vowel Or Consonant

Introduction

Write C# Program to check entered character vowel or consonant. I have used Visual Studio 2012 for debugging purpose. But you can use any version of visul studio as per your availability..

using System;
 
public class charpexercise
{
    static void Main(string[] args)
    {
        char ch;
 
        Console.WriteLine("Enter any character: ");
        ch = Convert.ToChar(Console.ReadLine());
 
 
        // Condition for vowel checking
        if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' || ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U')
        {
 
            Console.WriteLine(ch + " is Vowel.");
 
        }
        else if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
        {
            Console.WriteLine(ch + " is Consonant.");            
        }
 
        Console.ReadLine();
    }
}

Result

Write C# Program to check entered character vowel or consonant
Write C# Program to check entered character vowel or consonant

Export HTML String to PDF file in C#

C# Program to get Length of Array

TaggedWrite C# Program to check entered character vowel or consonant

Python Examples

Introduction: Python Examples are the basic programming concepts of python like python syntax,python data types,,python operators,python if else,python comments etc.. …

Read more

C String Functions

C String Functions perform certain operations, It provides many useful string functions which can come into action. The <string.h> header …

Read more