Thursday, February 7, 2019

//Application of Conditional statement

import java.util.*;
class Prog
{
  public static void main(String args[ ] )
   {
      Scanner ob=new Scanner(System.in);

      int x,y;

      System.out.print("Enter the numbers:");
      x=ob.nextInt( );
      y=ob.nextInt( );

     if(x = =y)
      System.out.println("Both numbers are equal");

     if(x>y)
       System.out.println(x+"is largest");
     else
      System.out.println(y+" is largest");
   }
}
 



3 comments:

  3.WAP IN JAVA TO INPUT THREE NUMBERS AND COUNT HOW MANY OF THEM ARE EVEN .   import java.util.*; class Prog {   public static ...