The only thing I see that is wrong is you input as int instead of float or double like assignment wants? When it is correct you will probably get 5 for int, then 5.6999999->5.7000001 with float and 5.6999999->5.700000000000001 with double.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
#include <iomanip>
int main()
{
//all inputs are with float type as if you had x and y as float. You could make them doubles also and cast that way
intconst a = 5.7f; //will implicitly cast to int which floors to 5
floatconst b = 5.7f; //no need to cast float is float
doubleconst c = 5.7f; //casts from float to double
std::cout.setprecision(16);
std::cout << "Int: " << a << std::endl;
std::cout << "Float: " << b << std::endl;
std::cout << "Double: " << c << std::endl;
return 0;
}