Originally posted by Gyanesh Sharma:
...I seem to think that if x is declared int in a program, x/3 would be a double. Will the outcome of x/3 be an int too? ...
The result of int division will be of type int, and it will always truncate. So, for example, if x is 5, then x/3 will result in 1.
If you wanted a double as a result, then at least one of the operands would need to be of type double.