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