Cout: precision 4 : cout setw setprecision « Console « C++






Cout: precision 4

Cout: precision 4
#include <iostream>
using namespace std;

int main()
{
  cout.precision(4);
  cout << 10.0/3.0 << '\n';

  return 0;
}



           
       








Related examples in the same category

1.Demonstrate an I/O manipulator: setprecision(2) and setw(20)Demonstrate an I/O manipulator: setprecision(2) and setw(20)
2.Uses I/O manipulators to display the table of squares and square roots.
3.Enters a character and outputs its octal, decimal, and hexadecimal code.