9 Aug 2019

  • August 09, 2019
  • Amitraj










// c++ program to calculate area using class              By Amit raj purohit
http://codevidyalay.blogspot.com

#include<iostream>
using namespace std;
class  shape
{
private:  
      int l,b,area;
public:
  void input()
  {
  cout<<"Enter l and b values:";
  cin>> l >>b;
  }
void calculate()
{
area= l*b;
}
void output()
{
cout<<"area is:"<<area;
}
};
int main()
{
shape  s;
s.input();
s.calculate();
s.output();


return 0;
}



OUTPUT:

Enter l and b values:5   6


area is:30

Translate

Popular Posts