Input
Output
#include <iostream> using namespace std; class Rectangle{ public: int length,breadth; float area; }; int main(){ Rectangle r1;// r1 is the object created for the class Rectangle r1.length = 5; r1.breadth = 6; cout << "Enter the length and breadth value: " ; cout << r1.length << " " << r1.breadth << endl;// accessing member data length & breadth r1.area = r1.length * r1.breadth; cout << "Area of the Rectangle: " << r1.area; return 0; }