C Sharp Program to check if a character is vowel or consonant
using System;
namespace Vowels_consonant
{
class Program
{
static void Main(string[] args)
{
char c;
Console.WriteLine("Please Enter the chatacter");
  c = Convert.ToChar(Console.ReadLine());
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
{
Console.WriteLine("Entered chahrater is vowel");
Console.ReadKey();
}
else
{ Console.WriteLine("Entered chahrater is Consonant");
Console.ReadKey();
}
}
}
}
Output.
Please enter a character.
a
Entered chahrater is vowel.
Please enter a character.
d
Entered chahrater is consonant.
namespace Vowels_consonant
{
class Program
{
static void Main(string[] args)
{
char c;
Console.WriteLine("Please Enter the chatacter");
  c = Convert.ToChar(Console.ReadLine());
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
{
Console.WriteLine("Entered chahrater is vowel");
Console.ReadKey();
}
else
{ Console.WriteLine("Entered chahrater is Consonant");
Console.ReadKey();
}
}
}
}
Output.
Please enter a character.
a
Entered chahrater is vowel.
Please enter a character.
d
Entered chahrater is consonant.
C Sharp Program to check if a character is vowel or consonant
Reviewed by LanguageExpert
on
August 19, 2017
Rating:
No comments