Q:

Branching Statement : else if ladder using C# Language

0

This Program is used to the largest three number using else if ladder statement using C# Language

All Answers

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

using System;

public class exam

 {

    public static void Main()

     {

        int x,y,z;



        Console.WriteLine("\n");

        Console.Write("Enter the 1st Value : ");

        x=int.Parse(Console.ReadLine());



        Console.WriteLine("\n");

        Console.Write("Enter the 2nd Value : ");

        y=int.Parse(Console.ReadLine());



        Console.WriteLine("\n");

        Console.Write("Enter the 3rd Value : ");

        z=int.Parse(Console.ReadLine());



        if((x>=y)&&(x>=z))

              {     Console.WriteLine("\nx is greater value");     }



        else if(y>=z)

              {      Console.WriteLine("\ny is greater value");     }

        else

            {        Console.WriteLine("\nz is greater value");      }

     }

  }

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