Re: Adding large numbers in C
Hi,
By large number I guess you mean number which cannot be stored in
normal datatype like long long int etc. So the only thing left is
either using Array or someother form of Data structure like link list
which will point to the individual digit of the bug number.
Now to add these thow number you only have to loop over one number and
add individual digit offcourse you need to take care of the carry's.
And store it again in the Array or same data structure that you have
used to store the big number.
I hope this has given you enough idea how to solve your problem.
.
Relevant Pages
- Re: Is there a class for a dynamicly resizable array?
... I need to store a string plus a data structure for each entry in ... I need to be able to store the elements in this array somehow. ... (comp.lang.cpp) - Re: Challenge: reading ascii data
... to store all the data before producing any output. ... So I use hashes to create a two-level "sparse array", ... PL/I takes less than 2 seconds on my old desktop. ... safe in assuming your PL/I code isn't using such a data structure? ... (comp.lang.fortran) - Re: ArrayList allowing more than 2G entries.
... Tom McGlynn wrote: ... If you want to implement it yourself, you'd really have to store the data in smaller hunks that the one big flat array that ArrayList has internally. ... I'd probably look to a disk-based data structure first, and then let your OS cache it in memory if there was enough memory available. ... (comp.lang.java.programmer) - Re: Is there a class for a dynamicly resizable array?
... I need to store a string plus a data structure for each entry in ... I need to be able to store the elements in this array somehow. ... (comp.lang.cpp) - Re: Finding the nearest match without reusing results
... comparing an array with a value generates an array of Trues and ... Any diff with wrong State or with used Store is implicitly zeroed out. ... Each must be larger than the absolute value of the maximum Sales ... go.....it just needs to return the closest match. ... (microsoft.public.excel.programming) |
|