(E-Mail Removed) wrote:

> Who can solve this?

>

> Wrte a class number which represents all numbers. Implement member

> functions to carry out the following arithmetic operations on class

> instances, add- which returns an object of class number whose value is

> the sum of the numbers added, subtract- returns an object of class

> number and value is the result subtracting the second number object

> from the first, multiply and divide (the return formats are the same as

> for add and subtract). Provide a suitable user interface for your

> program.

>

>

> Have fun guys
You could try handing this one in:

#include <stdio.h>

class Number

{

public:

Number& operator/(Number& n) { printf("assignment\n"); return n; }

Number& operator-(Number& n) { printf("an F for "); return n; }

Number& operator+(Number& n) { printf("I deserve "); return n; }

Number& operator*(Number& n) { printf("this "); return n; }

};

int main(int argc, char **argv)

{

class Number n;

(n + n - n) * n / n;

return 0;

}