You can OR together two or more flags: ios::uppercase | ios::scientific : cout setf « Console « C++






You can OR together two or more flags: ios::uppercase | ios::scientific

You can OR together two or more flags: ios::uppercase | ios::scientific
 


#include <iostream>
using namespace std;

int main()
{
  cout.setf(ios::uppercase | ios::scientific);

  cout << 1001.12;                    

  cout.unsetf(ios::uppercase);       // clear uppercase

  cout << " \n" << 1100.12;           

  return 0;
}



           
         
  








Related examples in the same category

1.cout: how to display float number, ios::showpoint, ios::showposcout: how to display float number, ios::showpoint, ios::showpos
2.cout.setf(ios::showpos | ios::showpoint) and cout.setf(ios::showpoint, ios::showpos | ios::showpoint)
3.Set cout: setf(ios::showpoint | ios::showpos, ios::showpoint)Set cout: setf(ios::showpoint | ios::showpos, ios::showpoint)
4.cout.setf(ios::hex)
5.cout.setf(ios::showbase)
6.cout.setf(ios::uppercase | ios::scientific)
7.Set cout: hex, basefield, setf(ios::hex, ios::basefield)Set cout: hex, basefield, setf(ios::hex, ios::basefield)