Write a c++ program to find area and furniture of a reactangle using upus concept
Answers
Answered by
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
English,
16 days ago
Environmental Sciences,
16 days ago
Math,
16 days ago
Social Sciences,
1 month ago
Math,
1 month ago
English,
9 months ago
Geography,
9 months ago