Please see the error and help me. Its showing error. I just can't understand where is the problem?? I have resolved all the errors that could be solved but still I am stuck. I know this is a vey simple question and its very frustrating.
The question is: Create a class calculate that uses two separate functions:-a function to multiply two float numbers and another to divide two float numbers using the concept of inline function. Also, create a method to print the result on the screen.
#include <iostream>
using namespace std;
class calculate
{
float a,b;
public:
float multiply(float a, float b);
float divide(float a, float b);
};
inline float calculate :: multiply(float a, float b)
{
return a*b;
}
inline float calculate :: divide(float a, float b)
{
return a/b;
}
int main()
{
float a,b;
cout<<"Enter two float numbers: ";
cin>>a>>b;
calculate obj (a,b);
cout<<"Multiplication: "<<obj.multiply(a,b)<<endl;
cout<<"Division: "<<obj.divide(a,b)<<endl;
return 0;
}