Q:

Write C# Program to check uppercase or lowercase alphabets

0

Write C# Program to check uppercase or lowercase alphabets.

All Answers

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

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());        
 
        if (ch >= 'a' && ch <= 'z')
        {
            Console.WriteLine(ch + " is lowercase alphabet ");            
        }
        else if (ch >= 'A' && ch <= 'Z')
        {
            Console.WriteLine(ch + " is uppercase alphabet ");                      
        }
        else
        {
            Console.WriteLine(ch + " is not an alphabet ");                      
        }
 
        Console.ReadLine();
    }
}

Result:

Enter any character: 

A

A is uppercase alphabet 

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

total answers (1)

Write C# Program to check entered character vowel ... >>
<< Write C# Program to check number is positive, nega...