C#

Branching Statement : if-esle statement

Branching Statement : if-esle statement
using System;

public class examif

{

  public static void Main()

   {

     int a;

    

      Console.Write("\nEnter the No : ");

      a = Convert.ToInt32(Console.ReadLine());



      if(a % 2 == 0)

       {

          Console.WriteLine("\nIt is Even Number");

       }

      else

       {

          Console.WriteLine("\nIt is Odd Number");

       }



    }

 }
Senthilvelan Sambamoorthy

Senthilvelan Sambamoorthy is working as a Professor in Department of Master of Computer Applications, Paavai Engineering College, Namakkal, Tamilnadu, India, He is Masters in Computers Applications. Having 18+ years of experience and his area of interest is Java, JSP, Servlet, J2EE, C#, PHP, Python ASP.NET, SQL Server and etc.