fork download
  1.  
  2. #include<iostream>
  3. using namespace std;
  4. class AreaFinder
  5. {
  6. float l, b, h;
  7. float result;
  8. public:
  9. AreaFinder(float hh = 0, float ll = 0, float bb = 0)
  10. {
  11. l = ll;
  12. b = bb;
  13. h = hh;
  14. }
  15. void Display(int ll)
  16. {
  17. if(l = 0)
  18. result = 3.14f * h * h;
  19. else
  20. result = l * b;
  21. cout<< result;
  22. }
  23. };
  24. int main()
  25. {
  26. AreaFinder objAF(10, 10, 20);
  27. objAF.Display(0);
  28. return 0;
  29. }
Success #stdin #stdout 0.01s 5272KB
stdin
Standard input is empty
stdout
Standard output is empty