Sets both the uppercase and scientific flags and clears the uppercase flag : cout scientific « Console « C++






Sets both the uppercase and scientific flags and clears the uppercase flag


#include <iostream>
using namespace std;
int main()
{
  cout.setf(ios::uppercase | ios::scientific);
  cout << 1010.112;                          
  cout.unsetf(ios::uppercase); // clear uppercase
  cout << endl << 1100.112; 
  return 0;
}


           
       








Related examples in the same category

1.cout: change formatscout: change formats
2.cout: number base, justification, and format flagscout: number base, justification, and format flags
3.Displays the value 100 with the showpos and showpoint flags turned on