netx_iit

find area of square and rectangle

Feb 10th, 2024
1,124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | Source Code | 0 0
  1. class p8
  2. {
  3.     public static void main(String args[])
  4.     {
  5.         double s=13;
  6.         double area=s*s;
  7.         System.out.println("Area of Square is "+area);
  8.        
  9.         double width=10.5;
  10.         double length=20;
  11.         double rarea=width*length;
  12.         System.out.println("Width "+width);
  13.         System.out.println("Lenght "+length);
  14.         System.out.println("Area of Rectangle is "+rarea);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment