So I want to print an integer as a double, so I used type casting. I do not want to change the type of the result variable, because I also want to assign to it integer arithmetic operations. Here is my code:
int result {0};
result = 40 / 60;
cout << "Result casted to a double " << (double)result << endl;//output: 0
Did I do something wrong here? Did I correctly cast the result to a double because here it seems that it does not work. Thanks in advance.