# beginner with a dumb question

• 07-14-2002
Unregistered
beginner with a dumb question

//How do I get answer to be decimal

answer = 10 - 2/5 - 8/5 - 3/8;

//endl;

return 0;
• 07-15-2002
XSquared
• 07-15-2002
Unregistered
that dont work
that dont work me son
• 07-15-2002
master5001
Hmmm. I just answered a similar question. But here you go anyway.

but you may also want to do your operations like this:
Code:

```float answer; answer = 10 - 2.0/5.0 - 8.0/5.0 - 3.0/8.0;```
• 07-15-2002
bennyandthejets
master, the reason you just answered a similar questioned is because i was going to answer this post, and found that i had no idea either!

but anyway, you shouldn't have to put:

Code:

`cout << (float)answer << endl;`
the (float) type casting is not necessary, but if you still cant do it that way just use double instead
• 07-15-2002
master5001
I see that the cycle of life has been completed then :) Anyway, I'm not too sure way the 2f/5f thing didn't work for you. I'm using mingw though. I don't know why something like that would make a difference. Oh well.