Trying to fix this D:!!!

I posted something about "what data type I should use for a decimal".... so I got some feedbacks about "float" and "double". I got some knowledge on these but only little. :( Anyways, how do I fix this? I want it the answer be a decimal.
1
2
division = int1 / int2; // Need fix!!!!
    cout << "Division is: " << division << endl;
Last edited on
Int divided by int gives int. If you want non-int, change one(or both) to not int.


1
2
division = (double)(int1) / int2; // Need fix!!!!
    cout << "Division is: " << division << endl;
At least one of the operands must be a floating point number.

double division = double(int1) / int2;

got ninja'ed indeed.
Last edited on
BOOM, Baby! NinJARED :p
lol Moschops. Thanks for the help.
Topic archived. No new replies allowed.