mardi 9 juillet 2019

How to print precise digits after E in scientific notation in c++

the output of the code is 1.068950000E+002 instead the required output is 1.068950000E+02

enter code here#include enter code here#include enter code hereusing namespace std; enter code hereint main() enter code here{ enter code heredouble c=106.895; cout<<fixed<<setprecision(9)<<std::scientific<<C<<endl; enter code herereturn 0; enter code here}

Aucun commentaire:

Enregistrer un commentaire