#include<iostream>
using namespace std;
class sample
{
int a,c;
public:
sample(int l, int b)
{
a=l;
c=b;
}
void area()
{
int result=a*c;
cout<<"area of rectangle is "<<result<<endl;
}
};
int main()
{
sample s(3,5);
s.area();
return 0;
}
using namespace std;
class sample
{
int a,c;
public:
sample(int l, int b)
{
a=l;
c=b;
}
void area()
{
int result=a*c;
cout<<"area of rectangle is "<<result<<endl;
}
};
int main()
{
sample s(3,5);
s.area();
return 0;
}
No comments:
Post a Comment