belongs to collection: all conditional programs in c# language
Write C# Program to check uppercase or lowercase alphabets.
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
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
I have used Visual Studio 2012 for debugging purpose. But you can use any version of visul studio as per your availability..
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