www.webdeveloper.com
Results 1 to 4 of 4

Thread: simple way of comparing different integers

  1. #1
    Join Date
    Jun 2014
    Posts
    1

    simple way of comparing different integers

    hi all..

    is there any easy way of comparing diff integers ? like

    i have four int a=1,b=4,c=1,d=9;

    and if i use if else it will be long way is there any sort ways of doing these ?

    i need something like

    if(a>b&&c>a&&d>a)

    {

    //a is greater

    }

    else if(b>a&&b>c&&b>c)

    {

    //b is greater

    }

    else if(a==b&&a>c&&a>d)

    {

    //a and b are equal

    }

    else if(a==b&&a==c&&a>d)

    {

    //a,b and c are equal

    }

    .

    .

    .etc

    can anyone can help me with this please?

  2. #2
    Join Date
    Jun 2014
    Posts
    8
    This is the best method to solve and compare the integers......

  3. #3
    Join Date
    May 2014
    Posts
    900
    Stick 'em in an array, and use Array.Sort
    http://msdn.microsoft.com/en-us/libr...rray.sort.aspx
    Java is to JavaScript as Ham is to Hamburger.

  4. #4
    Great and informative method dear.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles