Program to input 2 values length and breadth and check if it is a square or a rectangle JAVA


Write a Program to input 2 values length and breadth and check if it is a square or a rectangle.




import java.util.*;
class squarerectangle
{
    public static void main(String args[])
    {
         Scanner sc = new Scanner(System.in);
         int l = sc.nextInt();
         int b = sc.nextInt();
         if(l==b)
     
         System.out.println("It is a square");
         
         else
     
         System.out.println("It is a rectangle");
         
    }
}



     
                     

Contact Us

REACH US

SERVICES

  • CODING
  • ON-LINE PREPARATION
  • JAVA & PYTHON

ADDRESS

B-54, Krishna Bhawan, Parag Narain Road, Near Butler Palace Colony Lucknow
Contact:+ 919839520987
Email:info@alexsir.com