// mix2.cpp. // float output is formatted #include #include using namespace std; int main() { int n; float x; cout << setiosflags (ios::fixed | ios:: showpoint) << setprecision(7); n = 10.9; cout << "n is: " << n << endl; x = 10; cout << "x is: " << x << endl; x = x/3; cout << "x is: " << x << endl; n = x; cout << "n is: " << n << endl; return 0; } /* output: n is: 10 x is: 10.0000000 x is: 3.3333333 n is: 3 */