Write a program to display the area and perimeter of a rectangle

  • برمجة
  • برمجة سي بلس بلس
  • برمجة جافا

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

#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;
}
هل كان المحتوى مفيد؟

أسئلة مشابهة

القوائم الدراسية التي ينتمي لها السؤال

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...