posted 14 years ago
I don't know how easy or hard this is, but I am so confused and cannot think of it.
I have two arrays in reverse order.
So basically
Array a[]=321 ( ie the number is 123)
Array b[] = 9001 (i.e the number is 1009)
So I have to make a add method which accepts these two arrays as arguments.
Then I add those two numbers and return the value in string or an array, doesn't matter.
How do I do add and subtract method for this problem. As I have to make sure about the carry digit as if we add 9 and 3 its 12, so 1 is carry or so.
I hope you guys/gals understand my problem and if you have any questions then please let me know
Thanks in advance
Priya
I have two arrays in reverse order.
So basically
Array a[]=321 ( ie the number is 123)
Array b[] = 9001 (i.e the number is 1009)
So I have to make a add method which accepts these two arrays as arguments.
Then I add those two numbers and return the value in string or an array, doesn't matter.
How do I do add and subtract method for this problem. As I have to make sure about the carry digit as if we add 9 and 3 its 12, so 1 is carry or so.
I hope you guys/gals understand my problem and if you have any questions then please let me know
Thanks in advance
Priya
Help this poor girl...
Priya Ahuja
Greenhorn
Posts: 2
Michael Dunn
Ranch Hand
Posts: 4632
Don't touch me. And dont' touch this tiny ad:
ScroogeXHTML 7.2  RTF to HTML5 / XHTML converter
https://coderanch.com/t/692027/ScroogeXHTMLRTFHTMLXHTMLconverter
