Q:

Write a C# Sharp program that takes a character as input and check the input (lowercase) is a vowel, a digit, or any other symbol

0

Write a C# Sharp program that takes a character as input and check the input (lowercase) is a vowel, a digit, or any other symbol

Sample Output:

Input a symbol: a                                                                                             
It's a lowercase vowel.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using System;
public class Exercise9
{
    public static void Main()
    {
        char symbol;
         
        Console.Write("Input a symbol: ");
        symbol=Convert.ToChar(Console.ReadLine());
         
        if ((symbol == 'a') || (symbol == 'e') || (symbol == 'i') || 
                (symbol == 'o') || (symbol == 'u'))
            Console.WriteLine("It's a lowercase vowel.");
        else if ((symbol >= '0') && (symbol <= '9'))
            Console.WriteLine("It's a digit.");
        else
            Console.Write("It's another symbol.");        
    }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now