Write a program to display the area and perimeter of a rectangle
-
2020-11-25
- | daafoor
- | مشاهدات: 589
(Area and perimeter of a rectangle) Write a program to display the area and perimeter of a rectangle with the width of 4.5 and height of 7.9 using the following formula:
area= width*height
perimeter=2*(width+height)
========================================
double area=4.5*7.9;
double perimeter=2*(4.5+7.9);
System.out.println("area of rectangle is : "+area);
System.out.println("perimeter of rectangle is : "+perimeter);
التعليقات
لا يوجد تعليقات
لاضافة سؤال او تعليق على المشاركة يتوجب عليك تسجيل الدخول
تسجيل الدخول
تسجيل الدخول