C# Write a program that determines if the input letter is a VOWEL or CONSONANT. The vowels is are: A E I O U. Your program must be able to handle a capital or small input letter.
using System;
using System.Collections.Generic;
namespace App
{
class Program
{
public static void Main()
{
Console.Write("Enter the letter: ");
char letter = Console.ReadLine().ToUpper()[0];
if (letter == 'A' || letter == 'E' || letter == 'I' || letter == 'O' || letter == 'U')
{
Console.WriteLine("Letter is a VOWEL.");
}
else {
Console.WriteLine("Letter is a CONSONANT.");
}
Console.ReadLine();
}
}
}
Comments
Leave a comment