Computer Science, asked by vijaykumar4971, 1 month ago

Write a c++ program to find area and furniture of a reactangle using upus concept

Answers

Answered by fatimaamumtaz123
0

Answer:

#include<iostream>

using namespace std;

class Test {

public:

   int length, width, area;

 void input() {

       cout << "Enter length of rectangle:";

       cin >> length;

       cout << "Enter width of rectangle:";

       cin>>width;

   }

   void findArea() {

       area = length * width;

   }

  void display() {

       cout << "Area of rectangle is:" << area;

   }

};

int main() {

 Test obj;

  obj.input();

obj.findArea();

obj.display();

 return 0;

}

C++

Output:

Enter length of rectangle:12

Enter width of rectangle:2

Area of rectangle is:24

 

 

Similar questions