(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)

الأجوبة

ابحث عن مسائل برمجة سي بلس بلس | C++ programming بالانجليزي

ابحث عن مسائل برمجة جافا | Java programming بالانجليزي

الاجابة باستخدام c++

#include <stdio.h>

int main()
{
    int width=4.5;
    int height=7.9;
    int area= width*height;
    int perimeter=2*(width+height);
    cout<<"area of rectangle is: "<<area<<"\n";
    cout<<"perimeter of rectangle is: "<<perimeter<<"\n";
    return 0;
}

أسئلة مشابهة

محتاج مساعدة؟ تواصل مع مدرس اونلاين الان!