Saturday, 2 December 2017

Csharp Program to Obtain the Character from the User and Convert the Case of the Character


Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace casechange
{
    class Program
    {
        static void Main(string[] args)
        {
            char a;
            int i;
            Console.WriteLine("Enter the Character : ");
            a = Convert.ToChar(Console.ReadLine());
            i=(int)a;
            if (a >= 65 && a <= 90)
            {

                Console.WriteLine("The Character is : {0}", char.ToLower(a));

            }
            else if (a >= 97 && a <= 122)
            {
                Console.WriteLine("The Character is : {0}", char.ToUpper(a));
            }
            Console.ReadLine();
        }
    }


Output:

Enter the Character : a
The Character is : A


More C# Programs:




















100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...