#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
float x = 123.123556;
//output:123.124
cout << fixed <<setprecision(3) << x << endl;
return 0;
}

Hubert's Coding Notes
Useful notes for CS people
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
float x = 123.123556;
//output:123.124
cout << fixed <<setprecision(3) << x << endl;
return 0;
}