fork(1) download
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. int main(void) {
  5. float x,y;
  6. x= 2.3;
  7. y=2.123456;
  8. cout <<x;
  9. cout << setprecision(2)<<x;
  10. cout <<y;
  11. cout << setprecision(2)<<y;
  12. cout << setprecision(0)<<y ;
  13. return 0;
  14. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
2.32.32.12.12