Q:

Branching Statement : if-esle statement using C# Language

0

This Program is used to calculate the given number is Odd or Even using if-else statement

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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");

       }



    }

 }

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now