Experiment 19
Experiment 19
#include <iostream>
class Counter {
private:
int count;
public:
Counter() : count(0) {}
Counter operator++() {
++count;
return *this;
};
--c.count;
return c;
int main() {
Counter c;
c.display();
++c;
c.display();
--c;
c.display();
return 0;
o/p:-
#include <iostream>
#include <cmath>
int main() {
cout << "Area of Rectangle: " << area(length, width) << endl;
cout << "Area of Triangle: " << area(base, height, 0) << endl;
return 0;
o/p:-