Uppercase letters using bitwise AND. : bitwise AND « Operators statements « C++ Tutorial






#include <iostream>
using namespace std;

int main()
{
  char ch;

  for(int i = 0 ; i < 10; i++)  {
    ch = 'a' + i;
    cout << ch << " " ;
    ch = ch & 223;
    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.9.bitwise AND
3.9.1.Demonstrate bitwise &
3.9.2.Uppercase letters using bitwise AND.
3.9.3.determines if a value is a multiple of X