We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
importjava.io.*;importjava.util.*;publicclassSolution{publicstaticvoidmain(String[]args){Scannerscan=newScanner(System.in);intbreadth=scan.nextInt();intheight=scan.nextInt();intarea=1;scan.close();try{if(breadth>0&&height>0){area*=breadth*height;System.out.println(area);}else{thrownewException("java.lang.Exception: Breadth and height must be positive");}}catch(Exceptionex){System.out.println(ex.getMessage());}}}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Static Initializer Block
You are viewing a single comment's thread. Return to all comments →