[Solved] What is the data type of output if i get the product of integer and double? [closed]


When in doubt, try it out. In general, the higher precision will take precedence. So if you have a int and a double, the double is higher precision, so the result will have that form.

int number_1 = 3;
double number_2  = 1.5;
std::cout << number_1 * number_2;

Output:
    4.5

1

solved What is the data type of output if i get the product of integer and double? [closed]