All assignment operators have lower precedence than operator <<. So this
Code:
MayCal a = 50 , b = 30;
cout << "a++ = " << a=b << endl;
is equivalent to
Code:
MayCal a = 50 , b = 30;
cout << "a++ = " << a= (b << endl);
which requires class MyCal to have an operator<<() that accepts a stream manipulator - which yours does not. You probably intended something like
Code:
MayCal a = 50 , b = 30;
cout << "a++ = " << (a= b) << endl; // note brackets
For that to work, MyCal's assignment operator needs to return a reference to something (otherwise the result of the assignment cannot be streamed to cout). Currently, your operator=() does not have a return statement, so the function returns an invalid reference to the caller. That causes the "cout .... "statement to exhibit undefined behaviour (since, to output something, cout's streaming operator accesses a non-existent object via the reference).
And your MyCal needs to have a friend operator<<() in order to be streamed.