Turn on thread page Beta
    • Thread Starter
    Offline

    0
    ReputationRep:
    HI, have been learning c for a few months now but have got stuck on this problem I cant find a solution from the books i have can anyone help:

    Representing large numbers can lead to overflow errors on some systems. One method to prevent this is to use an array of integers to hold each digit of the number. A program is to be designed, written and tested which will allow pairs of integers to be read from a text file. The integers are added using two arrays for the input and the result is held in a third array. The resulting third array is to be displayed on the screen. The program will continue to read the input file, adding together integers and displaying the result until there is no more data on the file. You can assume that the file has two integers on every line. The integers may have different numbers of digits, but you can assume that they will not be greater than 20 digits in length.

    Thanks
    Offline

    0
    ReputationRep:
    what do you mean assume? I don't think you can assume... to make those numbers lets say less than 20 digits you could char them, couldn't you?
    • Thread Starter
    Offline

    0
    ReputationRep:
    thats exactly what the problem says, if i char them i dont think i can add them together properly
    Offline

    0
    ReputationRep:
    sorry, i'm not that good at c...

    Though if you add those numbers and the result becomes more than 20 digits long. Couldn't you just char the number to be 21 digits long or something? And why would you wanna add such a big numbers anyway?
 
 
 
Poll
Who is most responsible for your success at university

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.