ADVT POST

Comparing the greater value between 3 value if else condition

COMPARING THE GREATER VALUE BETWEEN 3 VALUES IF ELSE CONDITION

public class c_comparebiggervaluefrom3no {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
int a,b,c;
a=10;
b=20;
c=30;
    if(a>b)
            {
                 if(a>c)
                 {
                  System.out.println("A IS GREATER");
                 }
                 else
                 {
                  System.out.println("C IS GREATER");
                 }
          }
                 else
              {
                  if(c>b)
                  {
                      System.out.println("C IS GREATER");
                  }
                  else
                  {
                      System.out.println("B IS GREATER");
                  }
              }
            }
             }


Share on Google Plus
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.