Setprecision Manipulator Fixed and Scientific
The setprecision Manipulator is used with floating point numbers. It is used to set the number of digits printed to the right of the decimal point. This may be used in two forms: fixed and scientific These two forms are used when the keywords fixed or scientific are appropriately used before the setprecision manipulator. The keyword fixed before the setprecision manipulator prints the floating point number in fixed notation. The keyword scientific, before the setprecision manipulator, prints the floating point number in scientific notation.
using namespace std;
int main(){
cout.precision(3);
double n;
cin>>n;
cout<<fixed<<n<<endl;
cout<<scientific<<n;
return 0;
}