Wednesday 19 August 2015

Biggest Integer Number Program in C#.Net


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
// Note: We will give the integer numbers at the time of runtime
             int x, y, z;
            Console.WriteLine("enter x value");
            x = int.Parse(Console.ReadLine());
            Console.WriteLine("enter y value");
            y = int.Parse(Console.ReadLine());

            Console.WriteLine("enter x value");
            z = int.Parse(Console.ReadLine());
            if (x > y && x > z)
            {
                Console.WriteLine("x is biggest");
            }
            else if (y > z && y > x)
            {
                Console.WriteLine("y is biggest");
            }
            else
                Console.WriteLine("z is biggest");
            Console.ReadLine();
            }

                                         (OR) 
NOTE: At the time of compile Time we can give the integer Numbers


            int x = 10;
            int y = 20;
            int z = 30;
          //  Console.WriteLine("diplay the biggest integet");

            if (x > y)
            {
                Console.WriteLine("x is biggest");
            }
            else if (y > z)
            {
                Console.WriteLine("y is biggest");
            }
            else
                Console.WriteLine("z is biggest");
            Console.ReadLine();
        }
          }
    }

No comments:

Post a Comment