class Paralelogram{ double length; double breadth; } public class Main{ public static void main (String args[]){ Paralelogram para1 = new Paralelogram(); Paralelogram para2 = new Paralelogram(); double area; para1.length=8.5; para1.breadth=7.5; para2.length=5; para2.breadth=3; area=para1.length*para1.breadth; System.out.println("The Area is: " + area); area=para2.length*para2.breadth; System.out.println("The Area is: " + area); } }
The Output is Given Below:
The Area is: 63.75
The Area is: 15.0
0 comments:
Post a Comment