double a,b,c,g;
cout <<"Enter two whole numbers separated by space: ";
cin >> a >> b;
c = a / b;
g = a % b;
cout <<"The quotient of diving "<< a <<" by " << b <<" is "<< c <<endl;
cout <<"The remainder of diving "<< a <<" by " << b <<" is "<< d<<endl;
i want to find the remainder of diving a by b but there is a error at line g =a%b; and i dont know why?
another.Also there is no point of having a remainder for decimal division.
Of course there is a point. What if you wanted to limit a decimal to a certain range?
suyashsing234 is right that in C++ you cannot use % for double types.
That is what fmod() is for: http://www.cplusplus.com/reference/cmath/fmod/
(Don't be confused by modf, they're different functions)
In many other languages (e.g. C#) you wouldn't have this problem it all.