Sunday, March 5, 2017

Condition (if else) Statement

using System;
namespace ConditionApp
{
    class Program
    {
        static void Main(string[] args)
        {
            int firstNumber, secondNumber;

            Console.Write("Enter First Number :");
            firstNumber = Convert.ToInt32(Console.ReadLine());
            Console.Write("Enter Second Number:");
            secondNumber = Convert.ToInt32(Console.ReadLine());

            if(firstNumber==secondNumber)
            {
                Console.WriteLine("{0} is Equel {1}", firstNumber, secondNumber);
            }
            else if (firstNumber > secondNumber)
            {
                Console.WriteLine("{0} is Bigger then {1}", firstNumber, secondNumber);
            }
            else
            {
                Console.WriteLine("{0} is Less then {1}", firstNumber, secondNumber);
            }

            Console.ReadKey();
        }
    }
}

No comments:

Post a Comment