Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
551 B
1
Indexable
Never
#include<bits/stdc++.h>
using namespace std;

class Rectangle{
    int l,b;
public:

    Rectangle()
    {
        l=0;
        b=0;
        cout<<"L="<<l<<" B="<<b<<endl;
    }
    void setter(int le,int br)
    {
        l=le;
        b=br;
    }
    int lgetter()
    {
        return l;
    }
    int bgetter()
    {
        return b;
    }
    void area()
    {
        int arr=0.5*l*b;
        cout<<"Area:"<<arr<<endl;
    }

};

int main()
{
    Rectangle r;
    r.setter(5,10);
    r.area();
}




Leave a Comment