In C++, you can use the ‘precision’ function to set the precision of the output. The function ‘precision’ is present in the header file ‘iostream.h’. The following,
cout.precision(n);
will have totally print ‘n’ d igits in the output with the decimal point in between(say ‘x’ before the decimal and ‘n-x’ after the decimal. The value of x [...]
Posts Tagged ‘Header Files’
How to set precision in C++
June 1, 2009How to create header files in C/C++ ?
February 25, 2009First of all, does creating a header file useful at all ? If yes how ?
It obviously is or else we wouldn’t have had soemthing called a ‘header files’.
Next, can we create our own header files ?
Yes, you can. It is pretty simple and its going to make your program simple and customizable.
Let us start [...]
