Solution:
Like some of the other programming languages typecasting are possible and quite easy to do.
As far as your query is a concern, you asked to know the double-integer casting in c++
Either in Explicit Conversion:
#include <iostream>
using namespace std;
int main()
{
double x = 1.5;
// Explicit conversion from double to int
int sum = (int)x + 1;
cout << "Sum = " << sum;
return 0;
}
Or in Cast Operator:
#include <iostream>
using namespace std;
int main()
{
float f = 3.5;
// using cast operator
int b = static_cast<int>(f);
cout << b;
}
Above both programs will return an integer value. I hope you get this.