int to double in c++ code example
Example 1: c++ convert int to double
int a{5},b{2},c{9};
double d = (double)a / (double)b + (double)c;
Example 2: casting to a double in c++
double x;
x = (double) 25;
int a{5},b{2},c{9};
double d = (double)a / (double)b + (double)c;
double x;
x = (double) 25;