Add a function in your BaraBitKaar class from previous assignment as follows
BaraBitKaar Add(BaraBitKaar b);
When this function called in main() like
BaraBitKaar r;
r = p.Add(q); //this is how Add is supposed to be used to add p and q. Notice r receives the return which is of type BaraBitKaar.
r.PrintBinary(); //
should be able to add numbers p and q and put the result in r.make a new function Subtract in class BaraBitkaar i.e.
BaraBitKaar Subtract(BaraBitKaar b);
BaraBitKaar Multiply(BaraBitKaar b);
void Divide(BaraBitKaar b, BaraBitKaar & quotient, BaraBitKaar & remainder);
Make bitkaari unlimited as class AzeemBitKaar. It is truly unlimited. You will start with 1 byte array, and grow it when required to keep larger values.
Comments
Leave a comment