Monday, December 17, 2012

PROG. TO CHECK FOR ENTERED CHAR TO BE VOVEL


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication7
{
class Program
{
static void Main(string[] args)
{
char ch;
Console.Write("Enter any character: ");
String STRch = Console.ReadLine();
ch = char.Parse(STRch);
if (ch == 'a'
ch == 'e'
ch == 'i'
ch == 'o'
ch == 'u'
ch == 'A'
ch == 'E'
ch == 'I'
ch == 'O'
ch == 'U')
{
Console.WriteLine("Entered Key is VOVEL");
}
else
{
Console.WriteLine("Entered Key is CONSONANT");
}
Console.ReadLine();
}
}
}



/*----------------Output-------------------------------------*/

Enter any character: d

Entered Key is CONSONANT





No comments:

Post a Comment