Sunday 20 April 2014

If Else statement

Demonstration of if else statement in C#.

using System;
using System.Text;

namespace ifstatement
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter a Character:");
            char c = (char)Console.Read();

            if (Char.IsUpper(c))
            {
                Console.WriteLine("Character is UpperCase..!");
            }
            else if (Char.IsLower(c))
            {
                Console.WriteLine("Character is LowerCase..!");
            }
            else if (Char.IsDigit(c))
            {
                Console.WriteLine("Character is a number..!");
            }
            else
            {
            Console.WriteLine("Character is not a alphanumeric.!");
            }
            Console.ReadKey();
        }
    }
}

If anyone have any doubt about the program , please comment and you can also mail me on "ibsarmschauhan13@gmail.com" and "makansingh42@yahoo.com".

Thank you so much :)

No comments:

Post a Comment