Lowercase letters using bitwise OR. : bitwise OR « Operators statements « C++ Tutorial






#include <iostream>
using namespace std;

int main()
{
  char ch;

  for(int i = 0 ; i < 10; i++)  {
    ch = 'A' + i;
    // This statement turns on the 6th bit.

    cout << ch << " " ;
    ch = ch | 32;
    cout << ch << "\n";
  }
  return 0;
}
A a
B b
C c
D d
E e
F f
G g
H h
I i
J j








3.10.bitwise OR
3.10.1.Lowercase letters using bitwise OR.
3.10.2.Demonstrate bitwise |