Introduction to Algorithms:exercise2.1_4
Consider the problem of adding two n-bit binary integers, stored in two n-element arrays A
and B. The sum of the two integers should be stored in binary form in an (n + 1)-element
array C. State the problem formally and write pseudocode for adding the two integers.
bitset <n> A; A=0 | 1;
bitset <n> B; B =0|1;
require:bitset<n+1> C= A+B; C = 0|1;
My codes in C++: