Adding two binary numbers
Write DRY code:

DRY - Don't repeat yourself.

std::cout &lt;&lt; "Enter bits for first binary number \n";
for (int i = 0; i &lt; n1; i++)
{
   std::cin &gt;&gt; val;
   A.push_back(val);
}

std::cout &lt;&lt; "Enter bits for second binary number \n";
for (int i = 0; i &lt; n2; i++)
{
  std::cin &gt;&gt; val;
  B.push_back(val);
}


These two bits of code are way to similar. Make a function that does this work and pass as parameters any differences.

Highest order bit is where?

  std::cin &gt;&gt; val;
  B.push_back(val);


With this code your most significant bit is at location 0. This gives you no room to expand the number. Put the least significant bit at 0 and the more significant bits at higher locations. This will make it easier to do the standard maths operations in the long run.

This looks like a switch:

  if (sum == 0)
  {
     carry = 0;
     C[k] = 0;
  }
  else if (sum == 1)
  {
     carry = 0;
     C[k] = 1;
  }
  else if (sum == 2)
  {
     carry = 1;
     C[k] = 0;
  }
  else if (sum == 3)
  {
     carry = 1;
     C[k] = 1;
  }


I would write as:

  switch (sum) {
      case 0: carry = 0;C[k] = 0;break;
      case 1: carry = 0;C[k] = 1;break;
      case 2: carry = 1;C[k] = 0;break;
      case 3: carry = 1;C[k] = 1;break;
      default: throw std::exception("Something very wrong happened");
  }


Another case of DRY:

  while ( i &gt;= 0 &amp;&amp; j &gt;= 0 &amp;&amp; k &gt;= 0)
  {
      sum = A[i] + B[j] + carry;
      // STUFF
      k--;i--;j--;
  }
  //if size of first binary number is greter than first
  if (max_size == size_A)
  {
     while (i &gt;= 0 &amp;&amp; k &gt;= 0)
     {
        sum = A[i] + carry;
        // STUFF
        k--;i--;
     }
  }
  //If size of second binary number is greater than first
  else if (max_size == size_B)
  {
     while (j &gt;= 0 &amp;&amp; k &gt;= 0)
     {
       sum = B[j] + carry;
       // STUFF
      k--;j--;
     }
  }


Not only can all the "stuff" by factored out into its own function. But those three loops can be combined into a single loop.

  for(;k &gt;= 0;--k)
  {
      int a = (i &gt; 0) ? A[i--] : 0
      int b = (j &gt; 0) ? B[j--] : 0;
      sum = a + b + carry;
      // STUFF
  }