title: Binary numbers with leading zeros
body: <p>I've been working on an assignment where I've to use bitwise operators to (OR, AND, or NOT )</p>
  
  <p>the Program has a fixed 4X4 matrix and the user suppose to enter a query to the program ANDing two BINARY numbers, ORing them ...etc</p>
  
  <p>the problem is the "zero leading" binary numbers for example:0111 are shown with value 73 
  even when I manage to cout it with setfill() and setw() 
  I can't perform the bitwise operation on the actual binary value!</p>
  
  <p>N.B: I've tried strings instead of ints but the bitwise operation still doesn't apply.</p>
  
  <p>For Example:</p>
  
  <p>if I want to AND two binary values let's say 
  int x=1100 and int y=0100 in another int z
  z=x&y;</p>
  
  <p>the result suppose to be 0100
  But the result that appears is 64</p>
  
  <p>which also the result that appears if I tried to print y to the screen</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;iomanip&gt;
  using namespace std;
  
  int main()
  {
  
      int Matrix[4][4]={{1,1,0,0},{1,1,0,1},{1,1,0,1},{0,1,0,0}};
      string Doc[4]={"Doc1","Doc2","Doc3","Doc4"};
      string Term[4]={"T1","T2","T3","T4"};
  
      cout &lt;&lt; "THE MATRIX IS:"&lt;&lt;endl;
  
      for(int i=0;i&lt;4;i++)
      {
          cout&lt;&lt;"\t"&lt;&lt;Doc[i];
      }
      cout&lt;&lt;"\n";
      for(int row=0; row&lt;4;row++)
      {
          cout&lt;&lt;Term[row]&lt;&lt;"\t";
          for(int col=0;col&lt;4;col++)
          {
              cout&lt;&lt;Matrix[row][col]&lt;&lt;"\t";
          }
          cout&lt;&lt;endl;
      }
  
      int term1=1100;
      cout&lt;&lt;"\nTerm1= "&lt;&lt;term1;
      int term2=1101;
      cout&lt;&lt;"\nTerm2= "&lt;&lt;term2;
      int term3=1101;
      cout&lt;&lt;"\nTerm3= "&lt;&lt;term3;
      int term4=0100;
      cout&lt;&lt;"\nTerm4= "&lt;&lt;setfill('0')&lt;&lt;setw(4)&lt;&lt;term4;
  
  
      int Q=term1&amp;term4;
      cout&lt;&lt;"\n Term1 and Term4 ="&lt;&lt;Q;
  
      system("pause");
      return 0;
  }
  </code></pre>