Output float type number with scientific format : float output « Data Type « C++






Output float type number with scientific format

  
#include <iostream>
#include <iomanip>
using namespace std; 
int main(void){
   float value = 0.000123;

   cout << setiosflags(ios::scientific) << value << '\n';
 }
  
    
  








Related examples in the same category

1.Set precision for float number
2.Output float number with fixed flag
3.Change cout width and precision for string and float number output
4.Output float in default floating-point format
5.Floating-point values in system default, scientific, and fixed formats.
6.Controlling precision of floating-point values