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