I'm trying to learn how to code and I decided to try and make a calculator. I've got everything working but I can't get decimals from division. I've tried double and float and some other suggestions I've found but implementing one of them results in all division becoming 0.
Here is a snipet of the code:
I didn't bother to look at your "full code".
Presumably first and second are ints.
Just making result a double won't work.
Instead, you should make first and second doubles, which they obviously should be for a calculator anyway.
If you really needed a floating point result from an integer division, then you need to cast one of them to double: