std::scientific is a stream manipulator for real numbers to be displayed in the scientific notation.
#include <iostream> int main() { const double x = 123.456; std::cout << x << '\n' << std::fixed << x << '\n' << std::scientific << x << '\n'; }
Screen output: