result = number1 / number2;
I am new to C++, but I have some knowledge in Java.
What my program does is, the program asks the user two numbers. The user could only select, one, two, or zero. Then the user would select an arithmetic operator: plus, minus, times, divide. I figured everything out except the division part.
When the user select one divide by two, the answer should come out as 0.5, but it comes out as 0. All three variables are int values, so I would need to convert them into a float or a double. But how would I cast them? I've tried doing this, float(number1), and many more similar to that, but it wouldn't work.
Thanks,
Sam